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.8.0

Syntax

public bool ShadeFormData { get; set; }

Property Value

Type: Boolean

Examples

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

// By default, bookmarked text is highlighted gray
Assert.IsTrue(doc.ShadeFormData);

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

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

// We can turn the grey shading off so the bookmarked text will blend in with the other text
doc.ShadeFormData = false;
doc.Save(ArtifactsDir + "Document.ShadeFormData.docx");

See Also