Share via


DocumentBase.Frames Property

Definition

Gets a Frames collection that represents all the frames in the document.

public:
 property Microsoft::Office::Interop::Word::Frames ^ Frames { Microsoft::Office::Interop::Word::Frames ^ get(); };
public Microsoft.Office.Interop.Word.Frames Frames { get; }
member this.Frames : Microsoft.Office.Interop.Word.Frames
Public ReadOnly Property Frames As Frames

Property Value

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 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;
}
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 

Applies to