Set Layer visible in Visio

A

AppleMcIntosh

Hello

My problem is: I don't know how to set a layers property visible or
invisible by using the NAME of the Layer. I can set it by using the Layers
Index with following code:

Set ViewLay1 = Visio.ActivePage.PageSheet.Cells("Layers.Visible[4]")
ViewLay1.Formula = "=1"

But: How can I set it visible by using its Name? For example the Layers
name would be "myLayer1"?

Thanks for your help,
The Apple-man
 
K

Kevin Ayton

AppleMcIntosh said:
Hello

My problem is: I don't know how to set a layers property visible or
invisible by using the NAME of the Layer. I can set it by using the Layers
Index with following code:

Set ViewLay1 = Visio.ActivePage.PageSheet.Cells("Layers.Visible[4]")
ViewLay1.Formula = "=1"

But: How can I set it visible by using its Name? For example the Layers
name would be "myLayer1"?


Try:

Set layMylayer = ActivePage.Layers("myLayer1")
layMylayer.CellsC(visLayerVisible) = 1
layLayer.CellsC(visLayerPrint) = 1
etc

(You need to turn on printing for the layer if you want to print it or if
you want to export the picture)

Hope that helps (I'm using Visio 2000)

Kevin
 
A

AppleMcIntosh

Hello Kevin

Thanks for your help.
I found finally this solution.
Code if your interested in:

Dim layMylayer As Layer

Set layMylayer = Visio.ActivePage.Layers.Item("LayerOne")
layMylayer.CellsC(visLayerVisible) = 0

..It works

the Apple-man
 

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