0

The ArcMap table of Contents has several display modes - List By Drawing Order; List By Source etc (described here).

enter image description here

How or where this is saved? Is it saved within the MXD file or is there a system setting somewhere that controls it?

2 Answers 2

2

What you are asking about is called the "Last Tab Index", and it is a user-based setting stored in the registry and not in any MXDs. For ArcGIS 10.8.x, the registry setting is:

[HKEY_CURRENT_USER\SOFTWARE\ESRI\Desktop10.8\ArcMap\TOC\Views]
"Last Tab Index"=dword:00000000

The corresponding index values are:

0 = List By Drawing Order
1 = List By Source
2 = List By Visibility
3 = List By Selection

Any value besides one of those four will be changed at start-up back to 0 - List By Drawing Order.

1

They are just buttons that alter the view of the TOC. The status will be recorded within the MXD. You would need to use ArcObjects to interact with it in a programmatic way.

Here is the VBA you could run within the mxd that would return the actively selected button:

Public Sub Test()
    Dim pMXD As IMxDocument
    Set pMXD = ThisDocument
    Dim pCV As IContentsView3
    Set pCV = pMXD.CurrentContentsView
    Debug.Print pCV.Name
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.