Opening and controlling stencils and diagrams

B

byroncul

I am writing a windows form app in C# using the Visio SDK. I want the
user to open a file and only have access to a specific set of stencils
that I load for them..... regardless of what was saved with the file
previously. I can control the stencils shown by using...

axDrawingControl1.Document.Application.Documents.OpenEx("Basic_U.vss",
(short)Visio.VisOpenSaveArgs.visOpenDocked +
(short)Visio.VisOpenSaveArgs.visOpenRO);

The problem is when I attempt to use the OpenEX to get the vsd file
nothing shows up. I am using this line of code:

axDrawingControl1.Document.Application.Documents.OpenEx("d:\\test\
\test.vsd", (short)Visio.VisOpenSaveArgs.visOpenNoWorkspace);

If I use the SRC property like this:

axDrawingControl1.Src = openFileDialog.FileName

It shows up, but it contains the stencils I don't want them to have.

How can I control the stencils the user has access to?
 
B

byroncul

You can open another drawing with controlled stencils.

I'm sorry... I'm not following what you mean. The only way I have
found to open a drawing is using the axDrawingControl.Src property.
This property always opens the stencil(s) saved with the diagram.
What method/property can I use to open a vsd file without giving the
user any stencils? I have tried OpenEx and it does not work for vsd
files.
 
J

JuneTheSecond

I thought you shuld save the drawing after removing the stencil from your
drawing.
and open this drawing with src property.
 
A

Al Edlund

When you save the drawing (for later viewing) you might want to make sure
that the workspace is not being saved. In addition you can (within your
application) ensure that the shapes windows are not opening (I think there
are examples in the sdk on this)
al
 
B

byroncul

Thank you for the replies. The problem is I don't have any control
over how the original visio diagram was saved. The visio being opened
could have been saved with 20+ stencils opened in it. I am writing a
c# application that will be deployed to several users desktops. The
user could open any visio document in the application, but I don't
want them to have access to any stencils/shapes except the ones I
choose. The only way I have found to open a diagram is using the SRC
property, which also opens the stencils/shapes. I need to either..

1. Open a diagram without opening the stencil/shapes that were saved
with it (the OpenEx looks perfect for this, but does nothing). OR
2. Open a diagram with the stencils/shapes in it, but remove the ones
i don't want and add the ones I do. I haven't been able to find
anything that will close already opened stencils.

Anyone have any ideas?
 
P

Paul Herber

2. Open a diagram with the stencils/shapes in it, but remove the ones
i don't want and add the ones I do. I haven't been able to find
anything that will close already opened stencils.

I think this is the only way to do it.
 
K

kainster

i just want to ask a question, i want to use c++ to rewrite those codes
and what is "Visio.VisOpenSaveArgs.visOpenDocked" in C++?
thanks a lot !
 

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