Compartilhar via


DocumentBase.Frames Property

Gets a Frames collection that represents all the frames 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)

Syntax

'Declaration
Public ReadOnly Property Frames As Frames
public Frames Frames { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Frames
A Frames collection that represents all the frames in the document.

Examples

The following code example adds text to the first paragraph and then adds a text frame to the text. The code then changes the border of the text frame to wdLineStyleDouble. To use this example, run it from the ThisDocument class in a document-level project.

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 Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace