How do I restrict certian mail merge fileds from editing using Aspose.Word

Hi,

We are creating one word document referring an document template file(.dotx) file. We have used MailMerge fields in the .dotx file and while generating the document we are assigning values to them.
We are using the Book mark filed to get the values if edited in that document later also.

Customer Failure Site: «FASite»
Customer Point of Failure: «POF»
Customer Part Number: «PartNum»

Assigning BookMark

foreach (string fieldName in doc.MailMerge.GetFieldNames())
{
    if (fieldName.Equals("FASite"))
    {
        builder.MoveToMergeField(fieldName, false, false);

        builder.StartBookmark(fieldName);
        builder.MoveToMergeField(fieldName, true, false);
        builder.EndBookmark(fieldName);
    }
    else if (fieldName.Equals("POF"))
    {
        builder.MoveToMergeField(fieldName, false, false);
        builder.StartBookmark(fieldName);
        builder.MoveToMergeField(fieldName, true, false);
        builder.EndBookmark(fieldName);
    }
}

So if user is changing some thing in that “FASite” or “POF” filed then I can get the changes text by referring to the bookmark value.

However we required that the document should not be made editable to user completely, rather than some parts lets say only “POF” can be edited by user.

Could you please let us know, if we can achieve the same using Aspose.Word?

Please let us know, if any further information required.

Thanks,
Rajesh

Hi Rajesh,

Thanks for your inquiry. I think, you could set document protection (read-only for example) but allow “everyone” editing to a part of the document (POF field for example). It seems EditableRangeStart, EditableRangeEnd and EditableRange classes are what you can use to meet this requirement. But, unfortunately, currently, these classes don’t have any public constructors which can be used to define new Editable ranges. Your request has been linked to the appropriate issue (WORDSNET-9000) in our issue tracking system and you will be notified as soon as it is supported. Sorry for the inconvenience.

Best regards,

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

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