JMK
JMK

Reputation: 28059

How do I hide the UI when automating Visio?

I am automating Visio from Interop for an application. All is going well, the only problem is that I don't want the end user to see the visio canvas being populated, which is what is happening at the minute. I am (from .Net) programatically opening a Visio canvas and populating it with shapes, and this process is being displayed to the user.

I have looked through the properties for the Microsoft.Office.Interop.Visio.Application object, and the Microsoft.Office.Interop.Visio.Document and I can't find a boolean I can set to false to hide this from the user. I have automated both Excel and Access in the past, and in both there is simply a boolean you can set to false, and then the end user doesn't see the nuts and bolts of the automation process.

My question is, is there a way to hide the Visio UI from the end user when populating a canvas programatically with shapes via .Net Interop? If so, how do I do this?

Thanks

Upvotes: 1

Views: 1665

Answers (2)

JohnGoldsmith
JohnGoldsmith

Reputation: 2698

There's a ShowChanges property on the Application object, which might suit you:

http://msdn.microsoft.com/en-us/library/ff766801.aspx

Also, if you don't intend to display the application at all, you can use the IVInvisibleApp interface (on Microsoft.Office.Interop.Visio).

Check out the InvisibleApp object here:

http://msdn.microsoft.com/en-us/library/ff766890.aspx

Upvotes: 2

vcsjones
vcsjones

Reputation: 141638

On the Application object is a Windows property that contains a collection of Windows. You can iterate over the Windows and set the Window's Visible property to false.

Upvotes: 1

Related Questions