New To Visio, Need help to start VBA Code in VIsio

G

Gary

I am not new to VBA code. I have used VBA in Access. I have an application
where I have Visio OLE Objects embeded in Access Table. I was going to have
a layer parameter written out to a file. I want Visio to read this file and
control which layers become visible (unless there is a better way).

I don't know how that is done, like where do I put the VBA Code?? Is there
a way to run the code when the Visio file is preview or printed?? Or it must
be selected to run??? If that was the case, how can I do that via OLE
command???

What parameter need to be set to control the layers??? I tried using the
macro recorder to record the operation of selecting one layer and applying it
and another. I did understand things like item(1), item(2)? Some
suggestions???

Thank You,

Gary
 
C

Chris [Visio MVP]

To get acquainted with Layers, and the underlying structure, deselect all
shapes on the page, then choose Window .> Show Shapesheet.

You should find a Layers section in there - sort of a spreadsheet looking
thing. There's a row for each layer, and columns for non-printing, locked,
visible, etc. It makes sense when you see it.

When you change the layer properties via automation (code), you use access
layers from a page object, by name:

doc.Pages(1).Layers("Bob").

Install the "Developer's Reference" help and look up "CellsC" to get
examples on how to set the individual layer properties.

CellsC allows you to access these individual layer-columns and change their
values.
 
G

Gary

I am using Visio 2003 standard edition.

In access, I cal select the various event property to write my VBA code.
How does one see or open the various events to write VBA code???

Is there something like OnOpen event??? I would appreciate instructions
how to see it or I have to write VBA Sub that uses certain key names???

I hope I don't need the pro version???


Someone also indicate loading in the "Developer's Reference". I did see
something like this on the help drop down menu. Is this it?? Or I need
the pro version???


Thanks,

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top