The ASPOSE WORD API modifies the word document as SYSTEM and not as logged in user. Is there a way to do the processing as logged in user?
Could you please share some more detail about your issue and requirement along with input and output documents?
Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.
ASPOSEWordHeaderTest.zip (597 Bytes)
Attached is the sample java code which insert a text in word document header.
The file path of the word document is hard coded in code. Also we need one word document which has one table in document header with empty first row.
Here after executing the code the text will be inserted into document header with the SYSTEM account.
We want to execute the attached code with logged in user account so that the “last modified by” attribute of the word document will be changed to current logged user of the system.
You can use the BuiltInDocumentProperties.LastSavedBy property to set the name of the last author. Hope this helps you.
doc.getBuiltInDocumentProperties().setLastSavedBy("your user name");
doc.save(MyDir + "output.docx");
Thanks Tahir for prompt response.
The document would be a protected document and the logged in user would have edit access to it. If API runs as SYSTEM, then it is unable to edit the document since local account SYSTEM does not have access on the protected document
It seems that your query is not related to Aspose.Words. When document is saved to disk, the LastSavedBy property has value of current user. Accessing document at user login level is not related to Aspose.Words.