views:

167

answers:

1

We've created a flow chart using Visio that has multiple layers. (The background is that each layer represents variations on a basic process.)

Now we want to be able to print each layer individually. Currently this involves lots of clicking to select the correct layer and and then press print - then repeating this for each of the 10 layers.

Is there a simpler way? E.g. define each layer once and use a "print each layer" tool / macro?

+1  A: 

This is fairly easy through VBA. I tested it using the page export to jpeg, but the print should work as well. It just loops through all the layers in the active page, hiding every layer first, then unhiding the current looped layer, and prints.

Sub PrintLayers()
    Dim CurrShowLayer As Visio.Layer, CurrLayer As Visio.Layer
    For Each CurrShowLayer In ActivePage.Layers
        For Each CurrLayer In ActivePage.Layers
            CurrLayer.CellsC(visLayerVisible).Formula = "0"
        Next CurrLayer
        CurrShowLayer.CellsC(visLayerVisible).Formula = "1"
        ActivePage.Print
    Next CurrShowLayer
    For Each CurrLayer In ActivePage.Layers
        CurrLayer.CellsC(visLayerVisible).Formula = "1"
    Next CurrLayer
End Sub
Jon Fournier
Jon - apologies for the delay in replying. This question was on behalf of a colleague who has not yet tested your code. But since this is the only answer I will make this the accepted one. Thanks very much.
Mark Robinson