共用方式為


Page.AddGuide 方法 (Visio)

會將輔助線加入到繪圖頁面。

語法

expressionAddGuide( _Type_ , _xPos_ , _yPos_ )

表達 代表 Page 物件的變數。

參數

名稱 必要/選用 資料類型 描述
Type 必要 整數 要加入的輔助線類型。
xPos 必要 雙精確度 輔助線上的某個點的 x 座標。
yPos 必要 雙精確度 輔助線上的某個點的 y 座標。

傳回值

圖形

註解

下列由 Visio 型別程式庫所宣告的常數,對於輔助線類型而言是有效的值。

常數 描述
visPoint 1 輔助點
visHorz 2 水平輔助線
visVert 3 垂直輔助線

範例

下列巨集將示範如何將水平輔助線加入到頁面中。

 
Public Sub AddGuide_Example() 
 
 Dim vsoPages As Visio.Pages 
 Dim vsoPage As Visio.Page 
 Dim vsoShapes As Visio.Shapes 
 Dim vsoShape As Visio.Shape 
 Dim vsoPageHeightCell as Visio.Cell 
 Dim intPageHeightIU as Integer 
 
 'Get the Pages collection of the ThisDocument object. 
 Set vsoPages = ThisDocument.Pages 
 
 'Set the Page object to the first page of the Pages collection. 
 Set vsoPage = vsoPages(1) 
 
 'Get the Shapes collection of the vsoPage object. 
 Set vsoShapes = vsoPage.Shapes 
 
 'Get the page height in internal units. 
 Set vsoPageHeightCell = vsoPage.PageSheet.CellsSRC( _ 
 visSectionObject, visRowPage, visPageHeight) 
 intPageHeightIU = vsoPageHeightCell.ResultIU 
 
 'Add a guide to the Shapes collection and set it 
 'as the vsoShape object. The guide is a horizontal line 
 'running through the middle of the page. 
 Set vsoShape = vsoPage.AddGuide(visHorz,0,intPageHeightIU/2) 
 
End Sub

支援和意見反應

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