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)

public Frames Frames { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Frames

A Frames collection that represents all the frames in the document.

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 F:Microsoft.Office.Interop.Word.WdLineStyle.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;
}
Return to top
Show: