Product : Engine, Version : 4.x, ArticleID : 41023444

HowTo : We are looking for a function they can read out your LayerControl Sub and save all data (color, linetype, etc) in a file.

Article41023444
TypeHowTo
ProductEngine
Version4.x
Date Added2/16/2004
Submitted byHenry Knitsch
Keywords

Subject

We are looking for a function they can read out your LayerControl Sub and save all data (color, linetype, etc) in a file.

Summary

We are looking for a function that can read out your LayerControl Sub and save all data (color, linetype, etc) in a file.

Solution

You can use a code like :

Dim I       As Integer
Dim Lay     As vdLayer
    Debug.Print "Total Layers :  ", VD.ActiveDocument.Layers.Count
    Debug.Print String(255, "*")
    For I = 0 To VD.ActiveDocument.Layers.Count - 1
        Set Lay = VD.ActiveDocument.Layers.Item(I)
        Debug.Print "Handle :  ", Lay.Handle
        Debug.Print "Name :  ", Lay.LayerName
        Debug.Print "Frozen :  ", Lay.Frozen
        Debug.Print "Label :  ", Lay.Label
        Debug.Print "Line Weight :  ", Lay.LineWeight
        Debug.Print "Locked :  ", Lay.Lock
        Debug.Print "PenColor :  ", Lay.PenColor
        Debug.Print "PenStyle :  ", Lay.PenStyle
        Debug.Print String(255, "*")
    Next I

Note instead of the Debug.Print call you should use a code to write this information in a file or in a database.