Udostępnij za pośrednictwem


XMLNode.PlaceholderText Property (2007 System)

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
Public Property PlaceholderText As String
'Usage
Dim instance As XMLNode 
Dim value As String 

value = instance.PlaceholderText

instance.PlaceholderText = value
public string PlaceholderText { get; set; }
public:
property String^ PlaceholderText {
    String^ get ();
    void set (String^ value);
}
public function get PlaceholderText () : String 
public function set PlaceholderText (value : String)

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

See Also

Reference

XMLNode Class

XMLNode Members

Microsoft.Office.Tools.Word Namespace