Option Explicit
Public Sub LocationTable()
Dim shpObj As Visio.Shape, celObj As Visio.Cell
Dim ShpNo As Integer, Tabchr As String, localCent As Double
Dim LocationX As String, LocationY As String
Dim ShapeWidth As String, ShapeHeight As String
Open "C:\LocationTable.txt" For Output Shared As #1
Tabchr = Chr(9)
For ShpNo = 1 To Visio.ActivePage.Shapes.Count
Set shpObj = Visio.ActivePage.Shapes(ShpNo)
If Not shpObj.OneD Then
Set celObj = shpObj.Cells("pinx")
localCent = celObj.Result("inches")
LocationX = Format(localCent, "000.0000")
Set celObj = shpObj.Cells("piny")
localCent = celObj.Result("inches")
LocationY = Format(localCent, "000.0000")
Set celObj = shpObj.Cells("width")
localCent = celObj.Result("inches")
ShapeWidth = Format(localCent, "000.0000")
Set celObj = shpObj.Cells("height")
localCent = celObj.Result("inches")
ShapeHeight = Format(localCent, "000.0000")
Print #1, shpObj.Name; shpObj.Text; Tabchr; _
Tabchr; LocationX; Tabchr; LocationY; _
Tabchr; ShapeWidth; Tabchr; ShapeHeight
End If
Next ShpNo
Close #1
Set celObj = Nothing
Set shpObj = Nothing
End Sub
|