Consulting

Results 1 to 4 of 4

Thread: Visio VBA help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Jul 2016
    Posts
    4
    Location

    Visio VBA help

    I am trying to export shape data from my Visio flowchart. I am hoping to get the shape displayed text, shape number, associated hyperlink description, associated hyperlink address, and the associated comment. I would also be nice to know, if possible, what swimlane function the shape sites in. I also don't want OneD shape, and I only want the flowchart shapes. I figured out the OneD, but not flowchart only shapes. The Shape Report on in Visio doesn't allow me to select the fields I want for output. I created the code below, but can only get the shape text. I split them out so I could try each one. After a few hours, I have given up. Any suggestions?

    Sub ShapeInfoToFile()
          Dim strPath As String
          strPath = "C:\Users\collinsp\Documents\SSC\Chief Technical Officer\Enterprise Architecture\E2E Architecture Working Group\Process"
          Dim MyFile As String
          MyFile = strPath & "\E2EArchWG Visio Report"
          Open MyFile For Output As #2
          Dim vPage As Visio.Page
          Dim vShape As Visio.Shape
          Dim vShapeLinkDes As String
          Dim vShapeLink As String
          Dim Entry As String
          Set vPage = Visio.ActivePage
          ' Loop through shapes creating a string containing them all, writing to file
          For Each Shape In vPage.Shapes
              Set vShape = Shape
              If Not vShape.OneD Then
                  Set vShapeLinkDes = vShape.Hyperlink.Description.Value
                  Set vShapeLink = vShape.Hyperlink.Address.Value
                  Entry = vShape.Text
                  Entry = Entry + "," + vShape.Type
                  Entry = Entry + "," + vShapeLinkDes
                  Entry = Entry + "," + vShapeLink
                  Entry = Entry + "," + vShape.Comments
                  Write #2, Entry
              End If
         Next Shape
    End Sub
    Last edited by Aussiebear; 12-31-2024 at 04:05 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •