I am using Aspose Word to add Custom Properties to a document before I open it. Currently I do the following
_document = new Aspose.Words.Document((documentPath));
Where documentPath is a string to the location of my document.,
Once I have the document I can updated the Custom Properties.
What I have found is that this call invokes a (IncorrectPasswordException) so the properties do not get added,
When the document is launched Word prompts me for the password,
Now I did try the following.
loadOps.Password = promptValue;
_document = new Aspose.Words.Document((documentPath),loadOps)
This works and unprotects the document . However it seems to totally unprotect it. So Word launches without prompting for a password and if I check the Word Properties it is no longer protected. So if I save the document it saves unprotected.
My questions is how can I emulate Word behavior . If you Open a password protected document you do not need to enter the password again when you close the document.
How can I unprotect the document to add the custom properties whilst still maintaining the “protected” status of the document so that when it is closed it saves protected