Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-29-2017, 11:04 AM
jennybt jennybt is offline Navigation Pane Windows 7 64bit Navigation Pane Office 2013
Novice
Navigation Pane
 
Join Date: Jun 2017
Posts: 1
jennybt is on a distinguished road
Default 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
Reply With Quote
 

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 Navigation Pane windseaker Word 2 04-25-2014 10:34 AM
Navigation Pane savo Word 2 04-17-2013 07:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft