Table of contents
TOC
折叠目录
展开目录

Layer.Page 属性 (Visio)Layer.Page Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

获取包含图层的页面。只读。Gets the page that contains the layer. Read-only.

语法Syntax

表达式页面expression . Page

表达式_一个表示对象的变量。_expression A variable that represents a Layer object.

返回值Return Value

PagePage

注解Remarks

如果图层对象是一个母版而不是在页面,页面属性将返回Nothing 。不能设置Layer对象的页面属性。If the Layer object is in a master rather than in a page, the Page property returns Nothing . You cannot set the Page property of a Layer object.

示例Example

此 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用Page属性来从各种其他对象返回一个Page对象。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Page property to return a Page object from various other objects.

Public Sub Page_Example() 

 Dim vsoPage1 As Visio.Page 
 Dim vsoPage2 As Visio.Page 
 Dim vsoTempPage As Visio.Page 
 Dim vsoLayer1 As Visio.Layer 
 Dim vsoLayer2 As Visio.Layer 
 Dim vsoLayers1 As Visio.Layers 
 Dim vsoLayers2 As Visio.Layers 

 'Set the current page name to MyPage1. 
 ActivePage.Name = "MyPage1" 

 'Use the Page property to return the current 
 'Page object from the Window object. 
 Set vsoPage1 = ActiveWindow.Page 

 'Verify that the expected page was received. 
 Debug.Print "The active window contains: " &; vsoPage1.Name 

 'Add a second page named MyPage2. 
 Set vsoPage2 = ActiveDocument.Pages.Add 
 vsoPage2.Name = "MyPage2" 

 'Get the Layers collection from each page. 
 Set vsoLayers1 = vsoPage1.Layers 
 Set vsoLayers2 = vsoPage2.Layers 

 'Create a layer for each of the Layers collections. 
 Set vsoLayer1 = vsoLayers1.Add("ExampleLayer1") 
 Set vsoLayer2 = vsoLayers2.Add("ExampleLayer2") 

 'Use the Page property to return the Page object 
 'from a Layers object. 
 Set vsoTempPage = vsoLayers1.Page 

 'Verify that the expected page was received. 
 Debug.Print " vsoLayers1 is from: " &; vsoTempPage.Name 

 'Use the Page property to return the Page object 
 'from a Layer object. 
 Set vsoTempPage = vsoLayer2.Page 

 'Verify that the expected page was received. 
 Debug.Print " vsoLayer2 is from: " &; vsoTempPage.Name 

 'Set the active window's page to "MyPage1." 
 ActiveWindow.Page = "MyPage1" 

End Sub
© 2018 Microsoft