Reputation: 21
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?
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.
Upvotes: 1
Views: 621
Reputation: 499
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.
Upvotes: 0
Reputation: 1734
You must open document shapesheet window (urgent) and press Shape Data button
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
Upvotes: 0