Page.AddGuide method (Visio)
Adds a guide to a drawing page.
Syntax
expression. AddGuide
( _Type_
, _xPos_
, _yPos_
)
expression A variable that represents a Page object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Required | Integer | The type of guide to add. |
xPos | Required | Double | The x-coordinate of a point on the guide. |
yPos | Required | Double | The y-coordinate of a point on the guide. |
Return value
Shape
Remarks
The following constants declared by the Visio type library are valid values for guide types.
Constant | Value | Description |
---|---|---|
visPoint | 1 | Guide point |
visHorz | 2 | Horizontal guide |
visVert | 3 | Vertical guide |
Example
The following macro shows how to add a horizontal guide to a page.
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
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.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기