Muokkaa

Jaa


Frameset object (Word)

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

Remarks

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

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

Note

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

See also

Word Object Model Reference

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.