问题
I'm trying to find a way to program the new Navigation pane in Word 2010 to change tabs when a user selects a picture in the document. I can capture the selection change with WindowSelectionChange(ByVal Sel As Selection)
, but I can't figure out how change the tab from "Browse the headings" to "Browse the pages", which is what I want.
回答1:
According to the MVP on this thread, it's not programmable/searchable.
回答2:
It is possible using iAccessible!
Dim As IAccessible
Set oIA = CommandBars("Navigation")
oIA.Visible = True
Then deep recursively find a child with accName="Navigation"
and accRole=38
then its child with index 3 has accValue=NAVBAR
and accRole=60
Then the child 2 of NAVBAR is what you need.
.accDoDefaultAction CHILDID_SELF
来源:https://stackoverflow.com/questions/3401948/program-the-navigation-pane-in-word-2010