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

Free Support Forum - aspose.com

How to protect selected ranges in document using .NET

Hi,
I was wondering if it is possible to protect sections of a document rather than the entire thing? We have a requirement to parcel out sections of a word doc to be completed by various users. Each user should not be able to edit a section they have not been assigned to.

Therefore I figure our app could open the doc, and based on the user protect the document except the sections they are allowed to edit.

Any thoughts on this?

Cheers,
Brett

Apparently it is possible to protect document sections in MS Word so we should be able to allow the same in Aspose.Word. I’ll see if we can do this anytime soon.

It is possible to extract, remove and insert sections into a document using Aspose.Word easily. Maybe you can use this instead of protection. Say extract only sections that the user has access to and send them in a new document. Alternatively you can send them a whole document but on accepting the document just extract sections that they had the right to edit only.


Hello,

Is there any news regarding section protection?

Thnkx,

Diniz!

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can protect section of word document with AllowOnlyFormFileds protection type. Please find code example here:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.protectiontype.html

Hope this helps.

Best regards,

Perfect! It works great!
Thnkx a lot.

Diniz

Hi Alex,

I tried to enable few section of the document editable and remaining section of the document read-only. I used the sample code provided in the Aspose help file.

// Create a blank document
Document doc1 = new Document();

//// Insert two sections with some text
DocumentBuilder builder1 = new DocumentBuilder(doc1);
builder1.Writeln("Section 1. protected.");
builder1.InsertBreak(BreakType.SectionBreakContinuous);
builder1.Writeln("Section 2. unProtected.");
builder1.InsertBreak(BreakType.SectionBreakContinuous);
builder1.Writeln("");
builder1.Writeln("Section 3. Protected.");


// Section protection only works when document protection is turned and only editing in form fields is allowed.
doc1.Protect(ProtectionType.AllowOnlyFormFields);

// By default, all sections are protected, but we can selectively turn protection off.
doc1.Sections[1].ProtectedForForms = false;

return doc1;


This code makes section 2 editable. But in that editable section we could not add comments, bookmarks, footnotes and many more options. This limits the user's option to provide feedback on editable section's data.

Is there any workaround to accomplish this.

I have attached the docx file, that's generated using the above code. Please have a look at Section-2 in the docx which is editable.

Hi Senthil,

Thanks for your query. Aspose.Words mimics the same behavior as MS word do. If you protect a section with option “Filling in forms” by using MS Word, you will get the same output.

Please let us know if you have any more queries.

Hi Tahir,

Thanks for your response. I would like to know how can we code using aspose for the following scenario.

I have a document with few paragraphs, lets say 5 paragraphs. I would like to make para 2 & 4 editable and all other paragraphs are read-only. The editable section should not have any restriction, meaning user can able to enter comments, notes etc. Please recommend how we can achieve this with Aspose word for .NET

I'm still working on evaluation version. If we able to do this we are planning to make a purchase of Aspose word for .NET

Thank You.

Hi Senthil,

Thanks for your inquiry. I am afraid, currently Aspose.Words does not support protection (e.g. read only) of selected ranges (partial protection of document). Your request has been linked to the appropriate feature. We will let you know once this feature is supported.

The feature ID is WORDSNET-1067.

Secondly, I would suggest you please read the following article on Protecting Documents:
http://www.aspose.com/docs/display/wordsnet/Protecting+Documents

If we can help you with anything else, please feel free to ask.

Hi Tahir,

Thanks for the information. The partial protection in the document could be done by enabling the document-level read-only and providing the permission to edit a paragraph by using the openXML permStart and permEnd classes.

The paragraphs enclosed by permStart and permEnd becomes editable. Please let me know how we can use permStart/permEnd classes with Aspose for Word. Please suggest other best approaches we can use to make partial protection by using Aspose for Word

Thank You!

Hi Senthil,

Unfortunately, the requested feature is not available in Aspose.Words at the moment. We
will let you know once this feature is supported.

We apologize for your inconvenience.

Hi,

Is there any update on the readonly protection for a part of my document. Let's say I want to protect a single paragraph with readonly. Is this possible?

Greetings,

Bart

Hi Bart,


Thanks for your inquiry. I am afraid this feature WORDSNET-1067 has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.

We're an Aspose.Total subscriber and I just wanted to say that we would greatly appreciate the implementation of feature WORDSNET-1067.

Hi Devin,


Thanks for your inquiry.

I am afraid this feature WORDSNET-1067 had been postponed till a later date due to some other important issues and new features. We will update you via this forum thread once there is any update available about this feature. We apologize for your inconvenience.

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.
(50)