Word) (Frameset 物件

代表整個框架頁或框架頁中的單一框架。

註解

使用DocumentPane物件的Frameset屬性可傳回Frameset物件。

  • 對於會影響框架頁面上所有框架的屬性或方法,請使用Document物件中的Frameset物件 ( ActiveWindow.Document.Frameset) 。

  • 對於影響框架頁面上個別框架的屬性或方法,請使用Pane物件中的Frameset物件 () ActiveWindow.ActivePane.Frameset

這個範例會開啟名稱為 "Proposal.doc" 的檔案,並根據該檔案建立框架頁,然後新增包含該檔案之目錄的框架 (位於頁面左邊)。

Documents.Open "C:\My Documents\proposal.doc" 
ActiveDocument.ActiveWindow.ActivePane.NewFrameset 
ActiveDocument.ActiveWindow.ActivePane.TOCInFrameset

這個範例會在指定之框架的右邊新增框架。

ActiveDocument.ActiveWindow.ActivePane.Frameset _ 
 .AddNewFrame wdFramesetNewRight

這個範例會將框架頁中第三個子 Frameset 物件的名稱設定為 "BottomFrame"。

ActiveWindow.Document.Frameset _ 
 .ChildFramesetItem(3).FrameName = "BottomFrame"

本範例會將指定的框架連結至名為 「Order.htm」 的本機檔案。它會將框架設定為可調整大小、在網頁瀏覽器中顯示捲軸,以及設定為 25% 高至使用中視窗。

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

這個範例會設定 Microsoft Word 在指定的框架頁中顯示框架框線。

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

這個範例會將框架頁中的框架框線設定為 6 點寬,而且是深黃褐色。

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

注意事項

如需建立框架頁的詳細資訊,請參閱建立框架頁

請參閱

Word 物件模型參考資料

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應