Visio Guy

Visio Discussions => Programming & Code => Topic started by: ghenders on November 19, 2012, 01:24:10 AM

Title: access to the document shapesheet
Post by: ghenders on November 19, 2012, 01:24:10 AM
I don't see any documentation on this, so maybe I'm doing something wrong.  I'm trying to use the "User-defined Cells" section of the document's shapesheet to store some persistent values.    I know how to access the shapesheet for shapes and pages, but I'm not having any luck with the document shapesheet (is it read only?).  Any suggestions on VBA I can use in a userform to read / write to those cells?  Or are there better ways to store persistent global variables?
Title: Re: access to the document shapesheet
Post by: AndyW on November 19, 2012, 08:00:37 AM
To access the document sheet user cells, 'TheDoc!User.yourcell'
Title: Re: access to the document shapesheet
Post by: aledlund on November 19, 2012, 01:30:07 PM
the doc sheet for documents (and pages) can be accessed the same way as shapes

    Dim docSheet As Visio.Shape
    Dim visDoc As Visio.Document
    Set visDoc = Application.ActiveDocument
    Set docSheet = visDoc.DocumentSheet
    ' do something with the document sheet

    Dim pagSheet As Visio.Shape
    Dim visPage As Visio.Page
    Set visPage = Application.ActivePage
    Set pagSheet = visPage.PageSheet
    ' do something with the page sheet

al
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 47 (show)
Files included: 25 - 925KB. (show)
Memory used: 760KB.
Tokens: post-login.
Cache hits: 7: 0.00179s for 22,302 bytes (show)
Cache misses: 1: (show)
Queries used: 9.

[Show Queries]