How to add Clip Art & Task Pane

Started by SidRoy, January 19, 2009, 07:14:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SidRoy

Hi,
Im my C# application, i'm trying to integrate Clip Art and Task Pane along with many other menu items. The code i'm using is:

using vis = Microsoft.Office.Interop.Visio;

((DrawingPage)this.ActiveMdiChild).axDrawingControl.Window.Application.DoCmd((short)vis.VisUICmds.visCmdInsertClipArt);

((DrawingPage)this.ActiveMdiChild).axDrawingControl.Window.Application.DoCmd((short)vis.VisioCmd.VisUICmds.visCmdTaskPane);


But some how, its not working. I have successfully included other toolbar functionalities in my application using similar code. But its not working for Clip Art & Task Pane.
What am i doing wrong here? Please help me fix this.

Thanks in advance,
Roy

Visio Guy

Hi Roy,

I would guess that the Task Pane is disabled for the Visio control.

A test would be to see if you are able to get it to show up manually in any way when using the Visio control.

Clipart - I have no idea, I haven't ever played with that via automation.

- Chris
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

SidRoy

Hi Chris,
Yes i get that error saying "Requested operation is presently disabled". What do i do about this? How do i enable these operations that i'm calling?
I have observed a pattern while adding menubar/toolbar functionalities to my application. Functionalities like
Format - Text
Spelling Check
Insert - Picture - From File
etc, which open a dialog work fine using similar calling method:

((DrawingPage)this.ActiveMdiChild).axDrawingControl.Window.Application.DoCmd((short)vis.VisUICmds.visCmdFormatAllTextProps);

((DrawingPage)this.ActiveMdiChild).axDrawingControl.Window.Application.DoCmd((short)vis.VisUICmds.visCmdToolsSpelling);

((DrawingPage)this.ActiveMdiChild).axDrawingControl.Window.Application.DoCmd((short)vis.VisUICmds.visCmdFileImport);

Works perfectly fine.
But as soon as i use similar code to call functionalities like : Task Pane, Research, Insert -  Picture - ClipArt which open in a new window(task pane) at the right corner, it doesn't work giving me the same error "Requested operation is presently disabled". What actually is going wrong here? Please help me figure out a solution.

Thanks,
Roy

Visio Guy

My guess is that the designers at MS decided that the task pane, etc. "didn't make sense" in the context of the Visio control (or were prohibitively difficult to implement) and therefore disabled them on purpose.

For instance, the ShapeSheet is not available in the Visio control, nor is the VBA editor.

You'll probably have to re-create your own windows or panes or dialogs that mimic what you need.

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010