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

Propriedade Shape.ConnectionSiteCount (Editor)Shape.ConnectionSiteCount Property (Publisher)

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

Retorna um Long indicando a contagem de sites de conexão no objeto da forma atual. Somente leitura.Returns a Long indicating the count of connection sites on the current Shape object. Read-only.

SintaxeSyntax

expressão. ConnectionSiteCountexpression. ConnectionSiteCount

_expression_A variável que representa um objeto Shape ._expression_A variable that represents a Shape object.

ComentáriosRemarks

O número de sites de conexão varia de acordo com a geometria da forma. Os objetos retangulares, incluindo tabelas e controles de Web, provavelmente terão quatro sites de conexão, um centralizado em cada extremidade da forma.The number of connection sites varies depending on the shape geometry. Rectangular objects including tables and Web controls will most likely have four connection sites, one centered on each edge of the shape.

ExemploExample

Este exemplo adiciona dois retângulos na publicação ativa e os une a dois conectores. Os inícios dos dois conectores estão vinculados ao site de conexão um no primeiro retângulo; os finais dos conectores são vinculados ao primeiro e ao último site de conexão do segundo retângulo. Em seguida, ele conta o número de conexões no primeiro retângulo.This example adds two rectangles to the active publication and joins them with two connectors. The beginnings of both connectors attach to connection site one on the first rectangle; the ends of the connectors attach to the first and last connection sites of the second rectangle. Then it counts the number of connections on the first rectangle.

Sub Connections() 

 Dim shpNew As Shapes 
 Dim shpFirstRect As Shape 
 Dim shpSecondRect As Shape 
 Dim intLastSite As Integer 
 Dim intCount As Integer 

 Set shpNew = Application.ActiveDocument _ 
 .MasterPages(Item:=1).Shapes 
 Set shpFirstRect = shpNew.AddShape(Type:=msoShapeRectangle, _ 
 Left:=100, Top:=50, Width:=200, Height:=100) 
 Set shpSecondRect = shpNew.AddShape(msoShapeRectangle, _ 
 Left:=300, Top:=300, Width:=200, Height:=100) 
 varLastSite = shpSecondRect.ConnectionSiteCount 

 ' Add the first connector from rectangle 1, 
 ' site 1 to rectangle 2, site 1. 
 With shpNew.AddConnector(Type:=msoConnectorCurve, _ 
 BeginX:=0, BeginY:=0, EndX:=100, EndY:=100) _ 
 .ConnectorFormat 
 .BeginConnect ConnectedShape:=shpFirstRect, ConnectionSite:=1 
 .EndConnect ConnectedShape:=shpSecondRect, ConnectionSite:=1 
 End With 

 ' Add the second connector from rectangle 1, 
 ' site 1 to rectangle 2, site 2. 
 With shpNew.AddConnector(Type:=msoConnectorCurve, _ 
 BeginX:=0, BeginY:=0, EndX:=100, EndY:=100) _ 
 .ConnectorFormat 
 .BeginConnect ConnectedShape:=shpFirstRect, ConnectionSite:=1 
 .EndConnect ConnectedShape:=shpSecondRect, _ 
 ConnectionSite:=intLastSite 
 End With 

 intCount = shpFirstRect.ConnectionSiteCount 

End Sub
© 2018 Microsoft