Visio 2016 new drawing from Addin missing ribbon

Started by marie99, June 14, 2018, 05:15:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marie99

This is a weird one and I am stumped.  I have developed a few custom apps in C# that allow the user to click a backstage button, and the handler creates a new blank drawing.  A few weeks ago, a client using Visio 2016 noticed that the drawing opened with blank white space where the ribbon should be.  Hitting Alt-F to return to the backstage, then the arrow to return to the drawing makes the ribbon appear.  His users using Visio 2013 aren't seeing this.

I wrote a small addin that only has the one backstage button that opens a blank drawing:
VisioApplication.Documents.Add(string.Empty);
And this shows this problem.  I've used both VS 2010 and VS 2017, and see the problem in both.  I've also tried AddEx with no change.

Any idea on how to get Visio to fix this, or how I can work around it in code?  Is there code to go to the backstage, then return to the drawing so that I can simulate what the users now have to do?

Thanks for any help!

Nikolay

1. Can you share the code?
2. Have you tried to refresh the ribbon (ribbonUI.Invalidate)
3. Have you tried to move you action to Idle/NoEvenst pending?

marie99

I'd already tried ribbon.Invalidate with no effect, but moving the Documents.Add call on to the Idle handler did the trick.  Thanks for the tip!