The ArcMap table of Contents has several display modes - List By Drawing Order; List By Source etc (described here).
How or where this is saved? Is it saved within the MXD file or is there a system setting somewhere that controls it?
The ArcMap table of Contents has several display modes - List By Drawing Order; List By Source etc (described here).
How or where this is saved? Is it saved within the MXD file or is there a system setting somewhere that controls it?
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.
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