Visio 2013 COMMENTS PANE commandbar: how to display via VBA?

I need to control the visibility of the visio 2013 COMMENTS PANE.

Application.CommandBars("Commenting").Visible = False or True
      - works fine, IF the pane has already been displayed whilst the file is currently open. Otherwise, Application.CommandBars("Commenting").Visible <--- gives an error.

I want to achieve the vba equivalent of clicking the ribbon/REVIEW/COMMENTS PANE button, then I can control.visibility thereafter.
When I click the ribbon/REVIEW/COMMENTS PANE button, there is no signal in the Developer/Event monitor.

My fall-back position is to use vba On Error to detect the error of attempting to re-set the visibility of Application.CommandBars("Commenting") and then use MsgBox to ask the user to open the Comments Pane.

Who is Participating?
Rgonzo1971Connect With a Mentor Commented:

Unfortunately, I cannot see a command to open the Comments pane

unlike reviewer
Visio.Application.DoCmd (visCmdTaskPaneReviewer)   '1939

Kelvin4Author Commented:
Hi Rgonzo,
Thanks for your comment; the reference to the Visio DoCmd/DOCMD Commands was especially useful.

I also looked at several other faint cmdBar candidates for a 'Comments pane', and found none.

So have installed my fall back of 'On Error' testing if the Comment Pane has been launched, and if not, using the error handler to direct the user to launch it manually..

Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
With grateful thanks to fellow Visio MVP, John Goldsmith, here is a much more graceful solution to your problem:
toggles the Comments pane.

So, Rgonzo's approach was exactly correct -- but this particular command is undocumented.

How did John Goldsmith discover it? He turned on the EventMonitor and watched as he opened and closed the Comments pane.

Should have thought of that myself...
Kelvin4Author Commented:
Crickey - I should have seen it too!
Now I can clean up my act and send you my draft 'Article'.

Many thanks to you and John
- Kelvin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.