We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to make certain field as read-only field in the Merged document?

I have created the word template using merge fields and I have merged the document with the data table.Its working fine.

In the resultant document user able to modifiy the entire content but i want to restrict certain fields that should not modified by the user. How can i do this using Aspose?

I have tried doc.Protect() method, but that helps me to make the entire document as read only,restricting only the form fields … etc.(AllowOnlyComments,AllowOnlyFormFields,AllowOnlyRevisions,ReadOnly,NoProtection)

But in my case I am not using any FormField but using only the MergeField.

Please guide me to resolve this issue.

Thanks In Advance.

Bilal Nazer

Hi Bilal,
Well, do you use Aspose.Words, I have moved the thread to Aspose.Words forum, so, one of our developer will help you soon.
Thank you.

Thanks for your request. Unfortunately you can’t protect selected regions in your document. Using Aspose.Words you can protect only whole document or selective Sections (in case of using AllowOnlyFormFields).
As a workaround you can try using selective section protection. See the following link for more information.
Hope this helps.
Best regards.

Thanks Alexy.

Hello, maybe I can help you a little bit, I had the same problem in the past. I suppose you created first a template in word, with some predefined mergefields. I have attached a document template I use, with mergefields, but only this fields are protected, the rest of the document can be modified by users. So, try to unprotect it (password: visual), then in Protect Document panel you have the option Editing restrictions - select No changes (read-only), below that you must have Exceptions (optional): select each megefield one by one, and here check Everyone in Groups for exceptions, so only mergefield will be the exception. Hope this help

Thanks for your suggestion. However, note, that after executing mail merge using aspose.Words, whole document will be read-only protected. This is an issue #1494 in our defect database.
Best regards.

Oh, ok, I didn’t try this with Aspose, it is an old experience from Office Automation… I supposed that Aspose would protect only the protected fields in a document. However, this is a common issue in reports: you need to offer users the capability to format their word reports as they need, but you do not want to allow them to modify the merge fields extracted form the database; they should use the application for that, and generate the report again.

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

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