如何自动在一组形状周围绘制边框线?

如何自动在一组形状周围绘制边框线?

我想自动在如下所示的形状周围绘制边框。

在此处输入图片描述

有什么建议吗?

答案1

经过长时间的尝试和错误,我计算了偏移函数之前和之后页面上的形状,然后在 VBA 环境中选择了最后添加的形状索引,然后对Union它们进行了计算。

Public Sub makeborder()

Dim intCounter As Integer
Dim intShapeCount As Integer
Dim intShapeCount2 As Integer
Dim vsoShapes As Visio.Shapes
Dim vsoShapes2 As Visio.Shapes
Dim vsoSelection As Visio.Selection

Set vsoShapes = ActivePage.Shapes

intShapeCount = vsoShapes.Count

Application.ActiveWindow.Selection.Offset 0.045
Set vsoShapes2 = ActivePage.Shapes
intShapeCount2 = vsoShapes2.Count
ActiveWindow.DeselectAll
Set vsoSelection = ActiveWindow.Selection
For intCounter = intShapeCount + 1 To intShapeCount2
vsoSelection.Select vsoShapes(intCounter), visSelect
Next intCounter

vsoSelection.Union

End Sub

相关内容