Sort Shape Layer Names

K

Keith

I have over 30 layers in a large diagram. When I select the menu item
View>>Layer Properties, I can sort the layer names into ascending or
descending sequence by clicking the "Name" button. When I right-click a
shape and select Format>>Layer, the layer names on the Layer dialog window
are not displayed in alphabetic order. How can I sort the layer names on the
Layer dialog window?
 
K

Keith

This is an update to my original question... I recorded a macro to see what
Visio does when a new layer is assigned to a shape. The results were:

Sub OpenShapeLayerDialog()
'
' Open the Layer dialog window for the select shape.
'
' Keyboard Shortcut: Ctrl+Shift+K
'

Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Layer")

Application.ActiveWindow.Page.Shapes.ItemFromID(46).CellsSRC(visSectionObject, visRowLayerMem, visLayerMember).FormulaU = """0;1;2;62"""
Application.EndUndoScope UndoScopeID1, True

End Sub

The numbers 0, 1, 2, and 62 are indexes, beginning with zero, into the layer
name list that's displayed on the Layer dialog window. It's not an index
into the sorted list that's shown on the View>>Layer Properties window. So
if the list is sorted, it has to be able to determine what the index number
is supposed to be.

I'm not much of a VBA programmer, so I can't provide much more info than
this. It may be that I'll have to write my own dialog window. Or it could
be an enhancement to Visio! :)
 

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