Compartir a través de


propiedad Layer.Page (Visio)

Obtiene la página que contiene la capa. Solo lectura.

Sintaxis

expresión. Page

Expresión Variable que representa un objeto Layer .

Valor devuelto

Page

Comentarios

Si el objeto Layer está en un patrón en lugar de en una página, la propiedad Page devuelve Nothing. No se puede establecer la propiedad Page de un objeto Layer.

Ejemplo:

Esta macro de Microsoft Visual Basic para Aplicaciones (VBA) muestra cómo utilizar la propiedad Page para devolver un objeto Page de otros objetos.

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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.