How to print one layer at a time automatically using a macro

Started by Hlavender, September 14, 2017, 11:01:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hlavender

Hi

I have a Visio document with over 40 layers in it

I want to loop through  each of the layers and print them out - in another words When the macro runs, it should print layer 1, then print layer 2, etc.

Can you help me with the vba code that would allow me to do this?

OldSchool1948

This may help some


Private Sub PrintLayersOnAllPages()
    Dim vsoPage As Visio.Page
    Dim vsoLayer As Visio.Layer
    For Each vsoPage In Visio.ActiveDocument.Pages
        Debug.Print vsoPage.Name
        For Each vsoLayer In vsoPage.Layers
            Debug.Print vsoLayer.Name
        Next vsoLayer
        Debug.Print Chr(10)
    Next vsoPage
End Sub