Frameset Object

Microsoft Word Visual Basic

Multiple objectsFrameset
Frameset

Represents an entire frames page or a single frame on a frames page. There is no Framesets collection; each Document object or Pane object contains only one Frameset object.

Using the Frameset Object

Use the Frameset property to return the 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.

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.

ActiveDocument.ActiveWindow.ActivePane.Frameset _
    .AddNewFrame wdFramesetNewRight
		

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

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.

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.

ActiveDocument.ActiveWindow.ActivePane.Frameset _
    .FrameDisplayBorders = True
		

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

With ActiveWindow.Document.Frameset
    .FramesetBorderColor = wdColorTan
    .FramesetBorderWidth = 6
End With
		

Remarks

For more information on creating frames pages, see Creating frames pages.