DocumentShadeFormData Property
Specifies whether to turn on the gray shading on form fields.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public bool ShadeFormData { get; set; }

Property Value

Type: Boolean
Shows how to apply gray shading to bookmarks.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// By default, bookmarked text is highlighted gray

builder.Write("Text before bookmark. ");

builder.InsertTextInput("My bookmark", TextFormFieldType.Regular, "",
    "If gray shading is turned on, this is the text that will have a gray background.", 0);

// Our bookmarked text will appear gray here
doc.Save(ArtifactsDir + "Document.ShadeFormDataTrue.docx");

// In this file, shading will be turned off and the bookmarked text will blend in with the other text
doc.ShadeFormData = false;
doc.Save(ArtifactsDir + "Document.ShadeFormDataFalse.docx");
See Also