Compartilhar via


Frameset Object

Word Developer Reference

Represents an entire frames page or a single frame on a frames page.

Remarks

Use the Frameset propertyof a Document or Pane object to return a Frameset object.

  • For properties or methods that affect all frames on a frames page, use the Frameset object from the Document object (ActiveWindow.Document.Frameset).
  • For properties or methods that affect individual frames on a frames page, use the Frameset object from the Pane object (ActiveWindow.ActivePane.Frameset).

This example opens a file named "Proposal.doc," creates a frames page based on the file, and adds a frame (on the left side of the page) containing a table of contents for the file.

Visual Basic for Applications
  Documents.Open "C:\My Documents\proposal.doc"
ActiveDocument.ActiveWindow.ActivePane.NewFrameset
ActiveDocument.ActiveWindow.ActivePane.TOCInFrameset

This example adds a new frame to the right of the specified frame.

Visual Basic for Applications
  ActiveDocument.ActiveWindow.ActivePane.Frameset _
    .AddNewFrame wdFramesetNewRight

This example sets the name of the third child Frameset object of the frames page to "BottomFrame."

Visual Basic for Applications
  ActiveWindow.Document.Frameset _
    .ChildFramesetItem(3).FrameName = "BottomFrame"

This example links the specified frame to a local file called "Order.htm." It sets the frame to be resizable, to appear with scrollbars in a Web browser, and to be 25% as high as the active window.

Visual Basic for Applications
  With ActiveDocument.ActiveWindow.ActivePane.Frameset
    .FrameDefaultURL = "C:\My Documents\order.htm"
    .FrameLinkToFile = True
    .FrameResizable = True
    .FrameScrollbarType = wdScrollbarTypeYes
    .HeightType = wdFramesetSizeTypePercent
    .Height = 25
End With

This example sets Microsoft Word to display frame borders in the specified frames page.

Visual Basic for Applications
  ActiveDocument.ActiveWindow.ActivePane.Frameset _
    .FrameDisplayBorders = True

This example sets the frame borders on the frames page to be 6 points wide and tan.

Visual Basic for Applications
  With ActiveWindow.Document.Frameset
    .FramesetBorderColor = wdColorTan
    .FramesetBorderWidth = 6
End With
Bb179110.vs_note(en-us,office.12).gif  Note
For more information on creating frames pages, see Creating frames pages.

See Also