#1
|
|||
|
|||
Navigation Pane
Hello,
I am trying to automate the navigation pane to automatically search for comments when you open a document. My code works (as in it searches for the comments) but shows no results. The document I test it on has multiple comments and if I do this action manually, the navigation pane displays all the comments, as it should. The macro works when opening a document and searches for comments, but does not display results. Any help is appreciated! Code below (please note I have tried both creating a new module and word object for this). I have also tried different macros, SendKeys is my last resort, but if anyone knows of a better macro, please let me know! Private Sub Document_Open() ActiveWindow.DocumentMap = True ' Activate/Deactivate Navigation Pane ' Collapse All, to only show heading level 1 Set myRange = ActiveDocument.Content ActiveWindow.DocumentMap = True If ActiveWindow.DocumentMap = True Then ' Ctrl-F = Find --> this sets the cursor at the top of the navigation pane ' ^ = Ctrl key ' + = Shift key SendKeys "^(f){TAB}{ENTER}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TA B}{TAB}{TAB}{ENTER}{DOWN}{ENTER}" End If ActiveWindow.View.ShowComments = True End Sub |
#2
|
|||
|
|||
What are you trying to achieve with this code. Specifically why are you searching for comments using the navigation pane when you can easily access the comments collection as
Activedocument.comments |
Tags |
navigation pane, vba macro, vba word |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Navigation pane | BeverlyB | Word | 1 | 09-29-2014 12:10 PM |
Navigation pane | BeverlyB | Word | 2 | 09-18-2014 12:01 PM |
Navigation Pane | windseaker | Word | 2 | 04-25-2014 10:34 AM |
Navigation Pane | savo | Word | 2 | 04-17-2013 07:14 AM |