Way to read and set the visibility/printability/editability of a master layer in the context of a specific page?

I know how to read/set the visibility/printability/editability for a page layer.

I know how to read/set the normal "document-wide" visibility/printability/editability for a master layer.

However, the visibility/printability/editability of a master layer can, for any specific page, be set differently than the "document-wide" settings for that master layer through the "Current page, layers only" view of that page in the Object Manager.

Can that information be accessed through VBA?

Parents
No Data
Reply
  • I was able to do it, kinda a hack but it does work. I created a document with three pages, I added a MasterLayer named Master Layer 1. I hid the layer on Page 2.

    Here is my code:

    Sub MasterLayersIsVisible()
        Dim p As Page
        
        For Each p In ActiveDocument.Pages
            p.Activate
            p.Layers("MasterLayer 1").Activate
            Debug.Print p.Layers("MasterLayer 1").Name & " - " & p.Name & " Visible: " & ActiveLayer.Visible
        Next p
    End Sub
    

    Here is the output:

    MasterLayer 1 - Page 1 Visible: True
    MasterLayer 1 - Page 2 Visible: False
    MasterLayer 1 - Page 3 Visible: True

    Hope that helps,

    -Shelby

Children