Refresh TOC

2357
1
03-09-2013 10:39 AM
MaxWalker1
New Contributor
Hi,

I am trying to refesh all the tab in the TOC. I think that this code works. However I have no idea of knowing if it actually work.

Public Function contentsRefresh()

    Dim pmxdoc As IMxDocument
    Set pmxdoc = ThisDocument
    Dim pContentView As IContentsView
    Dim pCountView As Long
    pCountView = pmxdoc.ContentsViewCount

        For i = 0 To pCountView - 1
         Set pContentView = pmxdoc.contentsView(i)
         pContentView.Refresh (i)
        Next i
       
End Function

If somebody could help me debug this it would be greatly appreciated.

Cordially,
0 Kudos
1 Reply
LeoDonahue
Occasional Contributor III
Doesn't pmxdoc have a shortcut called "updateContents"?

I don't think you need to put it in a loop though.  It should update everything in the TOC.
0 Kudos