Expand Minimize

DocumentBase.InlineShapes Property

Gets an InlineShapes collection that represents all the InlineShape objects in the document.

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

public InlineShapes InlineShapes { get; }

Property Value

Type: Microsoft.Office.Interop.Word.InlineShapes
An InlineShapes collection that represents all the InlineShape objects in the document.

The following code example adds an inline shape (a horizontal line) to the document and then shows a message box displaying the number of inline shapes. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentInlineShapes()
{
    object myRange = this.Paragraphs[1].Range;
    this.InlineShapes.AddHorizontalLineStandard(ref myRange);
    MessageBox.Show("Total inline shapes: " +
        this.InlineShapes.Count.ToString());
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft