Results 1 to 4 of 4

Thread: Visio VBA help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Newbie
    Joined
    Jul 2016
    Posts
    4
    Location
    okay, figured out the Hyperlinks (because there could be multiple, I had to do a loop), now the comments, which are the most important

    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 Hyperlink
          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.Hyperlinks
                Entry = vShape.Text
                Entry = Entry + "," + vShape.Type
                Entry = Entry + "," + vShapeLinkDes
                ' Loop through the shape hyperlinks
                For Each vShapeLink In vShape.Hyperlinks
                    Entry = Entry + "," + vShape.Hyperlinks.Item(0).Description + "," + vShape.Hyperlinks.Item(0).Address
                    Next vShapeLink
                   Entry = Entry + "," + vShape.Comments
                   Write #2, Entry
               End If
         Next Shape
    End Sub
    Last edited by Aussiebear; 12-31-2024 at 04:08 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
  •