Share via


DocumentBase.Frames 屬性

取得 Frames 集合,表示文件中的所有框架。

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

語法

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

屬性值

型別:Microsoft.Office.Interop.Word.Frames
Frames 集合,表示文件中的所有框架。

範例

下列程式碼範例會將文字加入至第一個段落,然後將文字框架加入到文字中。 然後程式碼會將文字框架的框線變更為 wdLineStyleDouble。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentFrames()
    Dim textFrame As Word.Frame
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.Text = "Sample paragraph text."
    textFrame = Me.Frames.Add(Me.Paragraphs(1).Range)
    textFrame.Borders.OutsideLineStyle = Microsoft.Office.Interop. _
        Word.WdLineStyle.wdLineStyleDouble
End Sub 
private void DocumentFrames()
{
    Word.Frame textFrame;
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.Text = "Sample paragraph text.";
    textFrame = this.Frames.Add(this.Paragraphs[1].Range);
    textFrame.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word
        .WdLineStyle.wdLineStyleDouble;
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間