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)
Syntax
'Declaration
Property PlaceholderText As String
string PlaceholderText { get; set; }
Property Value
Type: System.String
The text displayed for an XMLNode control that contains no text.
Remarks
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.
Examples
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 Sub SetPlaceholderText()
Dim WordFalse As Integer = 0
Me.CustomerFirstNameNode.PlaceholderText = "Enter first name here"
Me.CustomerFirstNameNode.OwnerDocument.ActiveWindow.View.ShowXMLMarkup = _
WordFalse
End Sub
private void SetPlaceholderText()
{
int WordFalse = 0;
this.CustomerFirstNameNode.PlaceholderText = "Enter first name here";
this.CustomerFirstNameNode.OwnerDocument.ActiveWindow.View.ShowXMLMarkup =
WordFalse;
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.