Visio Drawing Control - VisUICmds

M

Michael

I have followed this Microsoft article:
http://msdn2.microsoft.com/en-us/library/aa192480(office.11).aspx
(Integrating Menus and Toolbars in Visio 2003 Drawing Control Applications)
and everything seems to work fine. But it seems some of the VisUICmds
commands are not workin, or I am using them wrong.

For instance:
SendCommand(VisUICmds.visCmdFileSaveAs); (save drawing) Works
But:
SendCommand(VisUICmds.visCmdFileOpen); doesnt work, and
SendCommand(VisUICmds.visCmdCreateNewDrawing); (new drawing) doesnt seem to
work.

I also found some other that did and did not work. Could someone tell me if
im doing anything wrong, and why visCmdFileOpen and visCmdCreateNewDrawing
don't seem to work.

Thanks,
Michael
 
A

Al Edlund

(wild stab in the dark) Since the save works, and the new stuff (create/open)
fails, I am wondering if you possibly have missed closing any existing
documents. The drawing control can only support a single open document.
al
 
D

David Parker

You probably don't realise that the Visio drawing control never opens an
existing drawing .. it actually opens a COPY of an existing drawing. To do
this, use the Src property of the drawing control, by setting its value to
the file path that you want to open.
By the same logic, do not expect Save to work either, because you must use
SaveAs to overwite the original file.
It is upto you to programmitacally set the properties of the original file,
if you want to prevent other uses from editing it directly.

Also, why are using DoCmd so much when there is an extensive object model
with properties and methods?
 
M

Michael

To which object model are you referring David? I only know how to use the
VisUICmds, couldnt find another one.
 
D

David Parker

When you use the drawing control, you initially set the src of the Visio
Drawing control, but then you can access the Visio object model via the
Document object of the rawing Control.
The Visio SDK has plenty examples of the Visio object model ... for example,
Document has a SaveAs and a SaveAsEx method
 

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