共用方式為


DocumentBase.InlineShapes Property

Definition

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

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 the document.

Examples

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());
}
Private Sub DocumentInlineShapes()
    Dim myRange As Object = Me.Paragraphs(1).Range
    Me.InlineShapes.AddHorizontalLineStandard(myRange)
    MessageBox.Show("Total inline shapes: " & Me.InlineShapes.Count.ToString())
End Sub

Applies to