Sub Macro1() Dim width As String Dim height As String If ActiveWindow.selection.Count = 0 Then Exit Sub Dim shape1 As Visio.shape Set shape1 = ActiveWindow.selection.Item(1) height = shape1.CellsSRC(visSectionObject, visRowXFormOut, visXFormHeight).FormulaU width = shape1.CellsSRC(visSectionObject, visRowXFormOut, visXFormWidth).FormulaU For i = 2 To ActiveWindow.selection.Count Step 1 Set shape1 = ActiveWindow.selection.Item(i) shape1.CellsSRC(visSectionObject, visRowXFormOut, visXFormWidth).FormulaU = width shape1.CellsSRC(visSectionObject, visRowXFormOut, visXFormHeight).FormulaU = height Next End Sub

评论