Compartilhar via


propriedade Layer.Page (Visio)

Retorna a página que contém a camada. Somente leitura.

Sintaxe

expression. Page

Expressão Uma variável que representa um objeto Layer .

Valor de retorno

Page

Comentários

Se o objeto Layer estiver em um mestre e não em uma página, a propriedade Page retornará Nothing. Não é possível definir a propriedade Page de um objeto Layer.

Exemplo

Esta macro do VBA (Microsoft Visual Basic for Applications) mostra como usar a propriedade Page para retornar um objeto Page dentre vários outros 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

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.