Can't edit output document

This should be really simple, but I don’t get it.

I have the following code:

Dim license As New Aspose.Words.License()
license.SetLicense("Aspose.Total.lic")

Dim doc As New Document(strBaseDirectory & strTemplateName)
'…processing here…
doc.Save(strFolder & strFileName)

The input file is a template, but is actually stored as a docx. I can edit this file.

Where I have … processing here… I have a number of “doc.Range.Replace” statements. For testing they have been removed.

My problem is that I am unable to edit the saved file. Right clicking on the document brings up the context menu with all the edit functionality disabled.

Many thanks

Richard

Hello,
Thank you for your request.
For the analysis we require your original document and the code that causes the problem. Could you please provide them to us.
Also please make sure that you are using the latest version of our product, you can take it here.

Code is pretty much as I had in my earlier post, but here is a full running and failing version.

Dim license As New Aspose.Words.License()
license.SetLicense("Aspose.Total.lic")

Dim strBaseDirectory As String = "c:\In house apps test folder\Documents"
Dim strTemplateName As String = "Device Deployment.docx"

Dim doc As New Document(strBaseDirectory & strTemplateName)

doc.Save(strBaseDirectory & "XXX" & strTemplateName)

I am using Word 2007, fully patched.

Many thanks

Richard

Thank you for additional information.
I managed to reproduce your problem on my side.
I have registered an appropriate issue in our defect database. Once the problem is solved, we will notify you immediately.
I would also like to note. You are using in your template fields like this: <>. Look please articles here in our documentation, which is dedicated to the questions of MailMerge. This technology is much simpler and more reliable than the replacement of the text. If you have any questions after reading, feel free to ask.

Is there any progress on this?

Richard

Hi Richard,
Thanks for your request. Unfortunately, the problem is still unresolved. The problem occurs because in your document protection type is specified but enforcement attribute is false, i.e. protection is not enforced. According to OOXML specification, If this attribute is omitted, then document protection settings shall not be enforced by applications. So Aspose.Words omits this attribute if it is false. But MS Word for some reason enforces protection in this case.
We will further investigate the issue and provide you more information. I apologize for inconvenience.
As a temporary workaround, you can just unprotect your document using Aspose.Words.
Best regards,

The issues you have found earlier (filed as WORDSNET-4700) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(4)