EvotecIT / PSWriteOffice

Experimental PowerShell Module to create and edit Microsoft Word, Microsoft Excel, and Microsoft PowerPoint documents without having Microsoft Office installed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get-OfficeWord error - Exception calling "Load" with "3" argument(s): "This isn't implemented yet?"

v-bulynkin opened this issue · comments

Hello! I'm trying to read a simple .docx file which has been created in Onlyoffice and getting the following error:

WARNING: Get-OfficeWord - File C:\temp\hamlet.docx couldn't be open.
Error: Exception calling "Load" with "3" argument(s): "This isn't implemented yet?"

Is it critical to have only MS Word-created source documents and what is the problem in this case when there's nothing special in the .docx file?

So this is related to me being "smart" and wanting to track what kind of functionality is not yet implemented. It's kind of useless because the word doc can be read and saved without having to know what it is.

This was fixed in:

But this library has not yet been updated to it. I need to sit down and resolve some conflicts and update library to new DLL which doesn't have this issue.

I've checked and it seems the Hamlet document implements FoonoteProperties/EndnoteProperties:

OK, thanks! Maybe it would be useful to have a key like -SkipIncompatible to skip all not supported properties during reading or ignore those properties by default...

No, it doesn't even make sense. It's complaining about those 2 entries

image

The thing is - unless you want to "change them" with PSWriteOffice or OfficeIMO you can use both and never notice there is an issue.

The only time it matters if we add/move/change sections and initially it was a problem

image

But we changed it that simply if it's not one of those things we don't support we simply clone them on the move and that's it. so unless you are after setting those settings, you can just ignore. And if you are a Developer there's "Debug" option where you will see this error now/

Could you really import this file?

PS C:\temp> $doc = Get-OfficeWord "C:\temp\hamlet.docx"
WARNING: Get-OfficeWord - File C:\temp\hamlet.docx couldn't be open. Error: Exception calling "Load" with "3" argument(s): "This isn't implemented yet?"

PS C:\temp> $doc.GetType()
You cannot call a method on a null-valued expression.
str:1 char:1
+ $doc.GetType()
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Not in PSWriteOffice current version... it needs to be updated. Current PSWriteOffice is based on 0.4.0 of OfficeIMO. While OfficeIMO is on 0.4.8 version now, soon to be on 0.4.9 with more features: https://github.com/EvotecIT/OfficeIMO/releases

The exception was removed on 0.4.7 version

Ah, now I see. Well, waiting for the next version and thanks for this great module!