Bookmark.XMLParentNode Property (2007 System)

Gets an XMLNode object that represents the parent node of a Bookmark control.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property XMLParentNode As XMLNode
'Usage
Dim instance As Bookmark 
Dim value As XMLNode 

value = instance.XMLParentNode
[BrowsableAttribute(false)]
public XMLNode XMLParentNode { get; }
[BrowsableAttribute(false)]
public:
property XMLNode^ XMLParentNode {
    XMLNode^ get ();
}
public function get XMLParentNode () : XMLNode

Property Value

Type: XMLNode
An XMLNode object that represents the parent node of a Bookmark control.

Examples

The following code example inserts XML into the document and creates a Bookmark control on the second word. It then inserts additional XML into the bookmark and displays the text of the XMLParentNode in a message box.

This example is for a document-level customization.

Private Sub BookmarkParentNode()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.InsertParagraphBefore()

    Me.Paragraphs(1).Range.InsertXML( _
        "<example>This is an example.</example>")
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range.Words(2), "Bookmark1")

    Bookmark1.Characters.First.InsertXML("<character>T</character>")
    MessageBox.Show(Bookmark1.XMLParentNode.Text)

End Sub
private void BookmarkParentNode()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.InsertXML("<example>This is an example.</example>",
        ref missing);
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range.Words[2],
        "bookmark1");
    bookmark1.Characters.First.InsertXML("<character>T</character>", ref missing);

    MessageBox.Show(bookmark1.XMLParentNode.Text);
}

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace