Share via


DocumentBase.InlineShapes 屬性

取得 InlineShapes 集合,表示文件中的所有 InlineShape 物件。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property InlineShapes As InlineShapes
public InlineShapes InlineShapes { get; }

屬性值

型別:Microsoft.Office.Interop.Word.InlineShapes
InlineShapes 集合,表示文件中的所有 InlineShape 物件。

範例

下列程式碼範例會將內嵌圖案 (Inline Shape) (水平線) 加入至文件,然後顯示訊息方塊說明內嵌圖案的數目。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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
private void DocumentInlineShapes()
{
    object myRange = this.Paragraphs[1].Range;
    this.InlineShapes.AddHorizontalLineStandard(ref myRange);
    MessageBox.Show("Total inline shapes: " +
        this.InlineShapes.Count.ToString());
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間