Trying to programmatically display Visio's layer dialog

R

rusty.brackett

I have the Visio 2003 Drawing Control embedded in a WinForm app. I am
attempting to display the layer dialog (the one from the shape context
menu (R Click shape then Format | Layer...). I need to do this
programmatically and haven't had any success. I have been able to
launch other Visio dialogs without any problems (including the "Layer
Setup" dialog (visCmdLayerSetupDlg) on the main menu via [View | Layer
properties...]) so I am pretty sure all my Visio objects are
initialized properly.

Here is how I am calling the method:

Application visioApp = axDrawingControl1.Document.Application;
visioApp.DoCmd((short)VisUICmds.visCmdLayerDlg);


The error I am receiving is:

"Requested operation is presently disabled."

Can anyone tell me what I am doing wrong? Has anyone been able to get
this to work?

Thanks,

Russell
 
K

Kari Yli-Kuha

I have the Visio 2003 Drawing Control embedded in a WinForm app. I am
attempting to display the layer dialog (the one from the shape context
menu (R Click shape then Format | Layer...). I need to do this
programmatically and haven't had any success. I have been able to
launch other Visio dialogs without any problems (including the "Layer
Setup" dialog (visCmdLayerSetupDlg) on the main menu via [View | Layer
properties...]) so I am pretty sure all my Visio objects are
initialized properly.

Here is how I am calling the method:

Application visioApp = axDrawingControl1.Document.Application;
visioApp.DoCmd((short)VisUICmds.visCmdLayerDlg);


The error I am receiving is:

"Requested operation is presently disabled."

Can anyone tell me what I am doing wrong? Has anyone been able to get
this to work?


You'll need to have a shape selected, otherwise you get the above msg.
Do you?

/C
 

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