Program the Navigation Pane in Word 2010

回眸只為那壹抹淺笑 提交于 2019-12-01 23:26:19

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!