1

When I create a Shape Data field on the Document Shapesheet how can I pull these Shape Data for the Document jsut like how I can do it for the page and a specific shape?

Document ShapeSheet window

I know I can use TheDoc! to pull User-Defined Cells and shape data, but I wanted to see if I can use the Shape Data instead.

This is an example of what I want to produce.

enter image description here

Laime
  • 21
  • 2

2 Answers2

0

How do this via user interface

You must open document shapesheet window (urgent) and press Shape Data button How documents shape data

How do this via code

Just run this routine

Sub CallCustomData()
On Error Resume Next ' without this line there will be an error if the date is not changed
Dim aw As Window ' the variable associated with the active window
Set aw = ActiveWindow ' the assignment to the variable associated with the active document window
Dim cl As Cell, wn As Window ' 
Set wn = ActiveDocument.DocumentSheet.OpenSheetWindow ' Open the document properties window
wn.WindowState = visWSMinimized ' minimize the document properties window
wn.Activate ' make the document properties window active
Set cl = ActiveDocument.DocumentSheet.Cells("Prop.row_1") ' the cell with the stored date
cl.Application.DoCmd (1312) ' call the Shape Data window
aw.Activate ' bring focus back to the active document window
wn.Close ' closing the document properties window
aw.WindowState = visWSMaximized ' restoring the size of the active document window
End Sub
Surrogate
  • 1,466
  • 2
  • 11
  • 13
  • Please add `shapesheet` tag – Surrogate Apr 11 '23 at 10:07
  • Thank you for the suggestion. This was an unknown way of accessing document shape data. Unfortunately, I’m wanting to access the documents shape data through the Shape Data window. This window can be toggled on/off through View->Task Panes->Shape Data. I’m able to view any shape data information from objects and pages but not the document. I’m trying to avoid opening the documents ShapeSheet. This is due to needing to enable the Developer tab of the Visio Ribbon. By using the Shape Data window, this provides a consistent user location for any shape data information object/page/document. – Laime Apr 17 '23 at 15:13
  • I've edited my initial post to hopefully clarify my initial question. – Laime Apr 17 '23 at 15:23
  • Sorry I dont know ways how call this kind of ShapeData Window. In my answer i call ShapeData window via DOCMD(1312). Window that you need must use DOCMD(1658). Full DOCMD list you can find [there](https://surrogate-tm.github.io/surrogate/DOCMD.htm). Not sure that [docked windows](http://visguy.com/vgforum/index.php?topic=174.0) can helps… – Surrogate Apr 17 '23 at 20:19
0

While directly accessing Document-level ShapeData isn't possible without jumping through some hoops, you can spoof it by using the SETATREF() function to "link" the cells to the PageSheet or a dedicated Shape. Example:

ThePage!Prop.Row_1.Label = TheDoc!Prop.Row_1.Label
ThePage!Prop.Row_1 = SETATREF(TheDoc!Prop.Row_1)
...

You may also want to prepend the Label with "Doc_" or something to make it clear to the user.

Vince
  • 467
  • 3
  • 8