Partilhar via


Bookmark.EnhMetaFileBits Property

Gets a picture representation of how the range of the Bookmark control appears.

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

Syntax

'Declaration
ReadOnly Property EnhMetaFileBits As Object
Object EnhMetaFileBits { get; }

Property Value

Type: System.Object
A picture representation of how the range of the Bookmark control appears.

Remarks

The EnhMetaFileBits property returns an array of bytes, which can be used with the Microsoft Windows APIs.

Examples

The following code example adds a Bookmark control with text to the first paragraph and then stores a picture representation of the text of the bookmark in a variable.

This example is for a document-level customization.

Private Sub BookmarkEnhMetaFileBits()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.Text = "This is sample bookmark text." 
    Dim pictureText As Object = Bookmark1.EnhMetaFileBits

End Sub
private void BookmarkEnhMetaFileBits()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    object pictureText = bookmark1.EnhMetaFileBits;
}

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace