Export (0) Print
Expand All

XMLNode.PlaceholderText Property

Gets or sets the text displayed for an XMLNode control that contains no text.

Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in microsoft.office.tools.word.dll)

public string PlaceholderText { get; set; }

Property Value

The text displayed for an XMLNode control that contains no text.

Placeholder text is displayed in Microsoft Office Word only when the Show XML tags in the document check box in the XML Structure task pane is cleared. The Show XML tags in the document check box corresponds to the ShowXMLMarkup property.

The following code example uses the PlaceholderText property to set the default text of an XMLNode, and then sets the ShowXMLMarkup property to 0 (zero) so that the XML tags are not displayed. This example assumes that the current document contains an XMLNode named CustomerFirstNameNode.

private void SetPlaceholderText()
{
    int WordFalse = 0;
    this.CustomerFirstNameNode.PlaceholderText = "Enter first name here";
    this.CustomerFirstNameNode.OwnerDocument.ActiveWindow.View.ShowXMLMarkup = 
        WordFalse;
}

Show:
© 2014 Microsoft