Recent Posts

Pages: 1 [2] 3 4 ... 10
Is it possible to format a shape in Microsoft Visio so that the shape has mouseover interactivity and can display a pop-up image or text box?  What steps in Visio would you execute to generate shapes like this in a process flowchart?
General Visio / Re: Reference page by ID instead of name
« Last post by wapperdude on October 23, 2021, 09:05:27 AM »
Proposed approach ought to work.  The question becomes a matter of minutes effort.  For a document with only a handful of pages, this wouldn't be too bad.  If the number of pages is quite high and/or vary over time, then automation (coding) is probably a better solution.  A bit more time upfront, but more accommodating to page count changes.
General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:58:31 PM »
Hi All, I have managed to achieve this using =SETF(GetRef(TheDoc!User.Project_Name),Prop._VisDM_Project_Name).
Still working on it but now moving forwards.
General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:25:27 PM »
Alternatively can I reference shape data directly from a separate page. ie something similar to the below ?

General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:04:56 PM »
Thanks all, The TOC was only one aspect of what i was trying to achieve and i am really struggling due to my programming knowledge. I have started to look at this from a completely different angle now.
  • add name of each page to specific text field (one for each page) to cover page
  • add drawing ID for each page in text field adjacent to page name on cover page
  • link project name and project id from cover page to specific field on each page
  • link cover page to external data
I was exploring the idea of using the document User-defined cells to store the data for project name and ID, then link each page to it. This seems to work but I am not sure if there was a way to link the document user cell to a shape data field so that when i link to external it updates the doc user field which in turn then updates all pages. If this is feasible I would then look at creating document user field for p1name, p2name, etc and push from each page.
So far i have only been able to access the document user fields through drawing explorer shapesheet. Can i reference specific pages and shapes from the document shapesheet or can i push to document user cells from any shapes shapesheet?
General Visio / Re: Reference page by ID instead of name
« Last post by Surrogate on October 22, 2021, 04:02:19 PM »
@Surrogate:  shapesheet solution!?!   :o. I can believe it's hard to explain.  That required a lot of creative/resourceful thinking!!!
Of course there is a lot of limitations:
1. User can rename page not more that one time;
2. The first figure to be dropped on the page is the text from which is to be displayed in the TOC.
Epic video just for lulz please watch it with English sub-titles

UPD few days ago i find this 3rd party macro for create TOC
Thank you Wapperdude that is also a possibility using the clipboard, copy from Excel, paste into a Visio shape's text then retrieve the text from the shape.

Thank you Surrogate I will give that code a try, need to change it a bit for VB.NET in particular the code using Variants to copy the Excel Cell contents into a Visio array, as we don't get to use these o-so-convenient-to-use Variants anymore in VB.NET.

(actually I use Option Strict as much as possible, which requires more effort programming but does make debugging simpler:).
With this code you can itterate all cells in selected range
Sub xls_query()
Dim oExcel As Object 'Excel.Application
Set oExcel = CreateObject("Excel.Application")
Dim sp As Object 'Excel.Workbook
Dim sht As Object 'Excel.Sheets
Dim tr As Object
Dim tc As Object
Dim qx As Integer
Dim qy As Integer
pth = Visio.ActiveDocument.Path
Dim ffs As FileDialogFilters
Dim sFileName As String
oExcel.Visible = True
Dim fd As FileDialog
Set fd = oExcel.FileDialog(msoFileDialogOpen)
With fd
.AllowMultiSelect = False
.InitialFileName = pth
 Set ffs = .Filters
    With ffs
        .Add "Excel", "*.xls*"
    End With
End With
sFileName = oExcel.FileDialog(msoFileDialogOpen).SelectedItems(1)
Set sp = oExcel.workbooks.Open(sFileName)
Dim UserRange As Object ' Excel.Range
Dim Total As Object 'Excel.Range
oExcel.GoTo Reference:=sp.Worksheets(1).Range("A2")
Set UserRange = oExcel.InputBox _
(Prompt:="Please select range", _
Title:="Select range", _
Set Total = UserRange
For Each tr In Total.Rows
    rc = rc + 1
    sc = 0
    For Each tc In Total.Rows.Columns
        sc = sc + 1
    Next tc
Next tr
ReDim arr(rc, sc) As Variant
For qx = 1 To rc
For qy = 1 To sc
Debug.Print Total.Cells(qx, qy) '
Next qy
Next qx
sp.Close SaveChanges:=False
End Sub
Not at my computer... cannot test direct approach, but what ought to work...

 In my original code, the Excel contents are placed into Visio shape as text (string).  Once pasted, use resultstr to retrieve and assign to a variable.  Delete the shape. 
Let users select a value from various statistical tables for various statistical distributions:

They only have to do this very rarely, so doing it this way is fine and they can use their own custom statistical table Excel file if they want this way.
Pages: 1 [2] 3 4 ... 10