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

Free Support Forum - aspose.com

How to protect non bookmarked Nodes of a document from being edited?

hi,
There is a requirement where only selected nodes should be editable in the word document.
I am able to bookmark those Nodes in the word document.
Is it possible to make the document read only except the bookmarked nodes?


<span style=“color: rgb(34, 34, 34); font-family: “Arial”,“sans-serif”; mso-ansi-language: EN;” lang=“EN”>Thanks.

please reply as soon as possible

Hi Nikhil,


Thanks for your inquiry. I think, you can implement the following workflow to meet this requirement.

  1. Move cursor to the last node before the start of Bookmark
  2. Insert SectionBreakContinuous using DocumentBuilder.InsertBreak Method
  3. Move cursor to the first node after the end of Bookmark
  4. Insert SectionBreakContinuous using DocumentBuilder.InsertBreak Method
  5. Above 4 steps will keep bookmarked content in a separate Section.
  6. Repeat the same steps for every Bookmarked content in your document
  7. Keep track of these newly created Sections
  8. Now apply document protection using Document.Protect(ProtectionType.AllowOnlyFormFields) method.
  9. Finally, selectively turn protections off for the Sections we created above e.g. doc.Sections[1].ProtectedForForms = false;

I hope, this helps.

Best regards,

hi Awais Hafeez,

If the document is in Newsletter format, Inserting SectionBreakContinuous causes formatting lost.
Is there any other approach?
reply as soon as possible please…

<span style=“color: rgb(34, 34, 34); font-family: “Arial”,“sans-serif”; mso-ansi-language: EN;” lang=“EN”>Thanks.

Hi Nikhil,

Thanks for your inquiry. 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,

hi Awais Hafeez,

Thanks Awais for your quick response. That is the most critical item on our list and hence will it be possible for you to share even a tentative time frame when I can expect this one to be available for our use? This would greatly help me plan our work schedules around it.

Also, is it possible to define protected editing on page level? If yes, how? I am facing a concern because the document page count and PAGE_BREAK count does not match. Hence, if I keep track of page breaks, it ideally does not give me an accurate number of pages in the document and hence I end up with erroneous results.

Looking forward to your response and thanks again for your help!

Best,
Nikhil



Hi Nikhil,


Thanks for your inquiry. We have asked the ETA of this issue from our development team and will update you as soon as any estimates are available.

Secondly, there is no concept of Page in Word document and I am afraid, it won’t be possible to define protected editing on page level.

Moreover, you can simply get the number of pages in the document as calculated by the most recent page layout operation by using Document.PageCount property. I hope, this helps.

Best regards,

Hiawais.hafeez is not online. Last active: 04-20-2015, 1:38 AM Awais Hafeez,
Is there any update for feature request WORDSNET-9000?

Hi Nikhil,

Thanks for your inquiry. This problem actually requires us to implement a new feature in Aspose.Words and we regret to share with you that implementation of this issue has been postponed for now. However, the fix of this problem may definitely come onto the product roadmap in the future. Unfortunately, we can not promise a resolution any time soon. We apologize for your 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.
(9)