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

Free Support Forum - aspose.com

Disable Yellow Color of Content of Editable Ranges using Java | Lock Watermark Shape | DOC Opened in Protected View

I am using
DocumentBuilder builder = new DocumentBuilder(doc);

It is highlighting the text in all the pages with Yellow color. How to disable that?
Also doc extn files are giving Some warning about doc is protected. How to disable this warning ?

Screen Shot 2020-03-27 at 8.19.46 PM.jpg (92.8 KB)
Screen Shot 2020-03-27 at 8.18.56 PM.png (131.9 KB)

Any help very much appreciated .


I see DOC problem is fixed in new version of aspose words.

DocumentBuilder builder = new DocumentBuilder(doc);
Screen Shot 2020-03-27 at 8.19.46 PM.jpg (92.8 KB)
Screen Shot 2020-03-27 at 8.18.56 PM.png (131.9 KB)

but when i use protect mode i am seeing two issues.

  1. Text in the edit range is default highlighted with YELLOW color. How to disable this ?
  2. For DOC extn files, it is giving a warning that “PROTECTED View” . How to disable this warning ?

Attached the documents for the error for reference


We tested the scenarios and have managed to reproduce the same problems on our end. For the sake of corrections, we have logged the following issues in our issue tracking system.

WORDSNET-20206: ProtectionType.ReadOnly causes MS Word to Open DOC in Protected View
WORDSNET-20207: Provide option to disable default Yellow color of content of Editable Ranges

We will further look into the details of these issues and will keep you updated on the status. We apologize for your inconvenience.

Is there any alternative approach with which i can just lock a shape object in header and leaving the rest of the document as editable without loosing user experience ?
This should be for both DOC and DOCX .

Thanks for the help.


Please ZIP and upload your sample input Word document and your expected document showing the desired behavior here for our reference. You can create this expected document by using MS Word. Please also list the complete steps that you performed in MS Word to create the expected document on your end. We will then investigate the scenario further on our end and provide you more information.

There is nothing specific about the doc. I created a doc in google docs and exported as docx. Doc will have multiple pages. Expectation is to have the watermark on the top right corner of the header on each page.

Attached sample and expected in zip fileArchive.zip (30.4 KB)


But in your supplied document i.e. “Sample_WM.docx”, we are able to delete the ‘Private’ Shape object located at the top-right Header corner using MS Word 2019 on our end. Can you please clarify a bit more, what do you mean by locking Shape in Header of Word document?

The standard way of adding watermark (text or shape) is mentioned in the following article:

I did not know that you expected us to put the locked Watermark one. I attached the locked one with two formats. WithWM.zip (32.0 KB)


Thanks for the additional information. We have logged these details in our issue tracking system and will keep you posted here on any further updates.

Any update on this ? what is the approximate ETA for the fix ?



I am afraid, your issues are not resolved yet and there are no estimates available at the moment. Once the analysis of both of these issues will be completed, we may then be able to calculate and share the ETA (estimates) with you. We apologize for any inconvenience.

There was one problem with Aspose cells. I raised a ticket for it but could you please also track similar issue for doc and docx also ?

image.png (48.1 KB)

We should not allow locked Shape to be deleted even in O365 online edit case but all the other document should be editable.

Ticket number for the Cells on your system is

CELLSJAVA-43156 – Locking WordArt Watermark does not work for Office 365


Thanks for the additional information. We have logged these details in our issue tracking system and will keep you posted on any further updates.


Regarding WORDSNET-20206 (ProtectionType.ReadOnly causes MS Word to Open DOC in Protected View), please note that the default editor group type is NONE. For DOC format, any type of editor group causes a “PROTECTED VIEW” problem, except EVERYONE. Therefore, the only solution is to set EditorType.Everyone into the StartEditableRange.

EditableRangeStart start = builder.startEditableRange();

So, this is an issue with MS Word i.e. any type of editor group except Everyone causes PROTECTED VIEW message while opening DOC-format document. Please set EVERYONE explicitly to get the desired output. Hope, this helps.


Regarding WORDSNET-20207, Unfortunately, Word documents do not store any property to disable highlighting (color) of editable regions. You can only disable yellow highlighting (color) of editable ranges be using macros.

However, we can offer you another way to add a watermark shape in Word document. Please see these input/output Word documents (Sample Docs 210662.zip (18.8 KB)) and try running the following Java code:

Document doc = new Document("E:\\Temp\\Input.docx");
Section mainSection = doc.getFirstSection();
HeaderFooter header = mainSection.getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY);
if (header == null)
    header = new HeaderFooter(doc, HeaderFooterType.HEADER_PRIMARY);

Section watermarkSection = (Section)mainSection.deepClone(false);

Shape watermark = new Shape(doc, ShapeType.TEXT_PLAIN_TEXT);

Paragraph watermarkPara = new Paragraph(doc);

header = new HeaderFooter(doc, HeaderFooterType.HEADER_PRIMARY);

doc.insertBefore(watermarkSection, mainSection);

but above solution is also imperfect.
Also unfortunately, documents using ‘Restrict Editing’ cannot be edited in Office 365 online version, because this feature is not implemented there.

4 posts were split to a new topic: Yellow Color of Content of Editable Ranges Turns Red after Calling Document.Unprotect Method C# .NET