PING: Alexey

I have a question for you Alexey. One of our requirements on this project is to be able to “lock down” non-editable areas of our Word document. Our original approach was a series of tables (what we call document sections). These tables are just 2 column tables with x-number of rows. The first collumn is simply a label describing the field, the 2nd column being the area a user can input and format text.

Our approach was to place a named bookmark in that column that we can then iterate through and grab the user entered data. We’ve already seen that the Aspose.Words component doesn’t support security exceptions for bookmarks.

Can you suggest another approach we might take for accomplishing the same type of task/requirement?

I’ve attached a sample document template to give you an idea of the layout of the Word template we base doc generation from.

Thanks in advance for any suggestions and/or help.

Hi
Thanks for your inquiry. I think that you can achieve this using form fields and protection type AllowOnlyFormFields. See the following link for more information.
https://reference.aspose.com/words/net/aspose.words/protectiontype/
You can extract entered values using the following code. Also see the attached document

//Open document
Document doc = new Document(@"301_109593_edegagne\in.doc");
//Extract values
string firstName = doc.Range.FormFields["FirstName"].Result;
string lastName = doc.Range.FormFields["LastName"].Result;
string company = doc.Range.FormFields["Company"].Result;

https://reference.aspose.com/words/net/aspose.words.fields/formfield/result/

I hope that this information will help you.
Best regards.

Yeah, I wish this were possible, but the requirement is that the end user be able to use styling in Word after the document is generated. Form fields lock out the ability to use any of Words styling features on the content.

We’ve actually got the 2-way Word to HTML and HTML to Word working through a preprocessing routine using RegEx’s, then a styling processing routine using a XSL transformation.

If we could just crack the security issue, we’d be very happy (as would the client).

Hi
Unfortunately, Aspose.Words doesn’t support protection of ranges at the moment.
Best regards.