@vgcnerella2019,
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();
mainSection.getBody().getFirstParagraph().getParagraphFormat().setPageBreakBefore(false);
mainSection.getPageSetup().setSectionStart(SectionStart.CONTINUOUS);
mainSection.setProtectedForForms(false);
HeaderFooter header = mainSection.getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY);
if (header == null)
{
header = new HeaderFooter(doc, HeaderFooterType.HEADER_PRIMARY);
mainSection.getHeadersFooters().add(header);
}
header.isLinkedToPrevious(true);
Section watermarkSection = (Section)mainSection.deepClone(false);
watermarkSection.setProtectedForForms(true);
Shape watermark = new Shape(doc, ShapeType.TEXT_PLAIN_TEXT);
watermark.getTextPath().setText("CONFIDENTIAL");
watermark.setWidth(500);
watermark.setHeight(100);
watermark.setRotation(-40);
watermark.getFill().setColor(Color.GRAY);
watermark.setStrokeColor(Color.GRAY);
watermark.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
watermark.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
watermark.setWrapType(WrapType.NONE);
watermark.setVerticalAlignment(VerticalAlignment.CENTER);
watermark.setHorizontalAlignment(HorizontalAlignment.CENTER);
Paragraph watermarkPara = new Paragraph(doc);
watermarkPara.appendChild(watermark);
header = new HeaderFooter(doc, HeaderFooterType.HEADER_PRIMARY);
watermarkSection.getHeadersFooters().add(header);
header.appendChild(watermarkPara);
doc.insertBefore(watermarkSection, mainSection);
doc.protect(ProtectionType.ALLOW_ONLY_FORM_FIELDS);
doc.save("E:\\Temp\\Output.docx");
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.