Table of contents
TOC
Recolher sumário
Expandir sumário

Método Selection.AddToGroup (Visio)Selection.AddToGroup Method (Visio)

office 365 dev account|Última Atualização: 22/03/2018
|
2 Colaboradores

Adiciona as formas selecionadas ao grupo selecionado.Adds the selected shapes to the selected group.

SintaxeSyntax

expressão . AddToGroupexpression . AddToGroup

expressão Uma variável que representa um objeto Selection .expression A variable that represents a Selection object.

Valor de retornoReturn Value

NadaNothing

ComentáriosRemarks

A seleção atual deve conter as formas a serem adicionadas e o grupo ao qual deseja adicioná-las. O grupo deve ser a seleção primária ou o único grupo na seleção.The current selection must contain both the shapes to add and the group to which you want to add them. The group must be the primary selection or the only group in the selection.

ExemploExample

A macro a seguir mostra como usar o método AddToGroup para adicionar formas selecionadas a um grupo selecionado.The following macro shows how to use the AddToGroup method to add selected shapes to a selected group.

Antes de executar essa macro, abra o estêncil Basic Shapes ou um documento baseado no modelo Basic Diagram .Before running this macro, open the Basic Shapes stencil or a document based on the Basic Diagram template.


Public Sub AddToGroup_Example() 

 Application.ActiveWindow.Page.Drop Application.Documents.Item("BASIC_U.VSS").Masters.ItemU("Square"), 3, 8 

 Application.ActiveWindow.Page.Drop Application.Documents.Item("BASIC_U.VSS").Masters.ItemU("Pentagon"), 4, 8 

 Application.ActiveWindow.SelectAll 

 ActiveWindow.DeselectAll 
 ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemU("Pentagon"), visSelect 
 ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemU("Square"), visSelect 
 ActiveWindow.Selection.Group 

 Application.ActiveWindow.Page.Drop Application.Documents.Item("BASIC_U.VSS").Masters.ItemU("Ellipse"), 5, 6 

 ActiveWindow.DeselectAll 
 ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemU("Ellipse"), visSelect 
 ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemU("Sheet.3"), visSelect 
 ActiveWindow.Selection.AddToGroup 

End Sub
© 2018 Microsoft