How to get a new blank doc with Visio 2003 Ax Control

J

Jeremy Horgan

Hi,

I am hosting the Visio 2003 ActiveX control on a WinForm. The Src property
opens a new document - that's fine. How do I get a new blank document?

I have tried:
drawingControl1.Window.NewWindow();
but doesn't appear to work.

Any ideas.

Thanks,
Jeremy


Environment:

VS.NET 2003, C#, XP
 
S

Scott Metzger

Jeremy said:
Hi,

I am hosting the Visio 2003 ActiveX control on a WinForm. The Src property
opens a new document - that's fine. How do I get a new blank document?

The one and only article on how to use the control tells us how to do
this...
http://msdn.microsoft.com/library/d.../odc_VSProgrammingwithVisioActiveXControl.asp

Basically you have 3 options...
1) Select all shapes and delete them
2) Load a new blank document using the Src property
3) Dynamically destroy and reinitialize the Visio Drawing control in the
document.

*:> Scott Metzger
 
S

Scott Metzger

Ok, now this behavior is really messed up and the documentation that
comes with Visio pretty much ensures that someone starting out
programming the control will get bitten by this.

If you specify the document at design time; it looks like you still need
to use one of the above methods to revert to a blank document. Which is
a PITA.

Its interesting to note that the Visio Shapesheet documentation says the
following:
"To specify a document at design time, set the Src property in the
Properties window in your Visual Basic project. This is the preferred
method."
 
J

Jeremy Horgan

M

Mai-lan [MS]

Hi, there: Just as some more information on the options.

On 1), if you just delete the shapes, you preserve any layers, etc. in the
document that you've loaded.
On 2), if you use SRC, you're doing the best practice of loading up a blank
document, but you have to know that you are going to lose any of the custom
formatting (like layers, etc.) from the previous document.
On 3), you can do this if you want but it's pretty drastic. It also might
have a bit of a performance implication.

Thanks,
Mai-lan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top