Share via


Bookmark.InlineShapes Property

Definition

Gets an InlineShapes collection that represents all the InlineShape objects in a Bookmark control.

public:
 property Microsoft::Office::Interop::Word::InlineShapes ^ InlineShapes { Microsoft::Office::Interop::Word::InlineShapes ^ get(); };
public Microsoft.Office.Interop.Word.InlineShapes InlineShapes { get; }
member this.InlineShapes : Microsoft.Office.Interop.Word.InlineShapes
Public ReadOnly Property InlineShapes As InlineShapes

Property Value

An InlineShapes collection that represents all the InlineShape objects in a Bookmark control.

Examples

The following code example adds a Bookmark control to the document and then adds a horizontal line to the bookmark. The code then displays the total number of inline shapes the bookmark contains in a message box.

This example is for a document-level customization.

private void BookmarkInlineShapes()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    object myRange = bookmark1.Range;
    bookmark1.InlineShapes.AddHorizontalLineStandard(ref myRange);
    MessageBox.Show("Number of inline shapes in bookmark1: " +
        bookmark1.InlineShapes.Count.ToString());
}
Private Sub BookmarkInlineShapes()
    Me.Paragraphs(1).Range.InsertParagraphBefore()

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.InlineShapes.AddHorizontalLineStandard(Bookmark1.Range)

    MessageBox.Show("Number of inline shapes in Bookmark1: " & _
        Bookmark1.InlineShapes.Count.ToString)

End Sub

Applies to