D
dave
Hi All,
I've really new to visio vba. What I want is automation of the 'drop' of
masters stencils onto a page. The shapes are basic rectangles My problem is
the size(width) of each master. I wish to lay them out end to end across
the page. I know the following code need some help. What I think it needs
is the pin x and pin y of the selected master stencil prior to being
dropped. I don't know how to access the master shape Pin x and Pin y
value with VBA. Any help would be appreciated
Dave
Sub Assembly()
Dim MoveAmount As Integer
Dim Frames As New Collection
Dim vsoShapeDone As Visio.Shape
Dim vsoSelection As Visio.Selection
Dim vsoPages As Visio.Pages
Dim vsoPage As Visio.Page
Dim vsoMaster As Variant
Dim vsoDocument As Visio.Document
RightHere = 57
Application.Windows.ItemEx("TheTarget").Activate
For I = 2 To 6
vsoMaster = "Master." & I
Set vsoShapeDone =
ActivePage.Drop(Application.Documents.Item("TheStencils.vss").Masters.ItemU(vsoMaster),
RightHere, 59)
MoveAmount = vsoShapeDone.CellsU("Width")
RightHere = RightHere + MoveAmount
Next I
End Sub
I've really new to visio vba. What I want is automation of the 'drop' of
masters stencils onto a page. The shapes are basic rectangles My problem is
the size(width) of each master. I wish to lay them out end to end across
the page. I know the following code need some help. What I think it needs
is the pin x and pin y of the selected master stencil prior to being
dropped. I don't know how to access the master shape Pin x and Pin y
value with VBA. Any help would be appreciated
Dave
Sub Assembly()
Dim MoveAmount As Integer
Dim Frames As New Collection
Dim vsoShapeDone As Visio.Shape
Dim vsoSelection As Visio.Selection
Dim vsoPages As Visio.Pages
Dim vsoPage As Visio.Page
Dim vsoMaster As Variant
Dim vsoDocument As Visio.Document
RightHere = 57
Application.Windows.ItemEx("TheTarget").Activate
For I = 2 To 6
vsoMaster = "Master." & I
Set vsoShapeDone =
ActivePage.Drop(Application.Documents.Item("TheStencils.vss").Masters.ItemU(vsoMaster),
RightHere, 59)
MoveAmount = vsoShapeDone.CellsU("Width")
RightHere = RightHere + MoveAmount
Next I
End Sub