Map of Russia
Visio map of Russia (with regions). The map is in native vector format.
Ported from the Wikipedia SVG.
Visio map of Russia (with regions). The map is in native vector format.
Ported from the Wikipedia SVG.
Recently I decided to start a website to present my Visio utilities in a “proper” way. Currently there is only the “Find command” plugin (updated version, plus x64 version), although there will a number of other Visio utilities in the nearest future.
Keep close eye on: http://unmanagedvisio.com
Labels: Addin, FindCommand, Office, Visio, Website
Have you ever tried to find a command in ribbon?
Here is a new add-in which allows to quickly find commands in Visio 2010. Just type in the keyword which is part of command name, and hit enter. All commands which contain this keyword will be shown by the plugin as buttons. You can either use the command found directly from the results pane, or add it to the quick launch toolbar.
The big picture:
Introductory video:
Limitations:
- Does not work with x64 version of Microsoft Visio 2010 yet.
- Search works in in English only yet.
Labels: Addin, Office 2010, Ribbon, Visio
It comes without saying that ribbon interface is cool, times easier to use (especially for developers =), and supports many new controls and neat features.
However, if you write a Visio add-in that targets multiple Visio versions at the same time, and have some custom buttons with images (with transparency), you might run into trouble with that new Visio 2010 Ribbon user interface needs different “flavor” of images compared to Visio 2003 and 2007. So you’ll have to to either create two separate sets of images (one set for pre-ribbon version of Visio, the second set for the ribbon one), or to “dance around a little” and make both versions consume the same set of images. The article focuses on the second approach I ended up with.
Read more »After this post in microsoft.public.visio.developers newsgroup I was asked a few times, how to save Visio shapes in external source exactly, so here is the code to store master/shape in a stream and then drop it back to the document:
To save Visio shapes in some external system (persist them) you can:
- Query master or shape you want to persist for IDataObject interface.
- Using this interface, obtain data blob in "Visio 11 Shapes" clipboard format (or maybe actually anything that contains “Shapes” word to be compatible with further Visio versions, please refer to the code).
Now this blob can be stored any way you want (database/memory/file/whatever). The sample code just saves it to a string variable in base64 encoding. To drop shapes back to the drawing, you can use "Drop" functions of Visio document/page. It turned out that these functions are happy enough with plain IDataObject interface passed in. So, to drop the stored master or shape back to the drawing:
- Create you own object that implements IDataObject interface.
- Load this object with your data
- Pass this object in one of those "Drop" functions (e.g. Page.Drop)
Labels: C#, C++, IDataObject, Office, Visio
This post explains how to make a ribbon tab in Visio 2010 ribbon document-specific. Means, activate a custom ribbon tab only for a specific document.
Download C# sample project (VS2008)
Download C++/ATL sample project (VS2008)
This article discusses the implementation of a document-specific tab in a COM add-in; also, it focuses on nasty details you might be interested in if you e.g. program unmanaged C++. Note that you could do this thing by other means, e.g. by embedding your custom interface in a document template using new Visio 2010 property Document.CustomUI.
Nevertheless, one of the ways to it is:
<customUI onLoad="OnLoad" ...>
// this function provides us with IRibbonUI object, called when XML is loaded
public void OnLoad(object obj)
{
vsoRibbonUI = (Office.IRibbonUI) obj;
}
Labels: C#, C++, Office 2010, Ribbon, Visio
This post explains how one can customize Visio 2010 Ribbon from Visio add-in (and is based on Visio CTP). Namely, it shows how to add a custom tab to the Visio ribbon.
Download C# sample project (VS 2008 solution, 12 Kb)
Download C++/ATL sample project (VS 2008 solution, 19 Kb)
Though Visio has been resistant to innovations in user interface for quite a long time (just remember those 16-color icons in the stencils), it seems that finally "the time has come", and the ribbon interface has won the game. I started this project to estimate the amount of work one needs to adopt his add-in to the new Ribbon interface. I should mention that old CommandBars API that was normally used for user interface customization does still work for new Visio 2010; the point is that it just looks a bit unnatural, and kind of unnatural.
The way it looked in Visio 2007, native toolbar and menu:
If you won’t do a thing, then in Visio 2010 you’ll get something like:
If you ask me, this doesn’t look like an exciting user experience… No transparency, no fancy 32-bit images, all custom toolbars (from all add-ins) are put to the “Custom Toolbars” group, all custom menus (from all add-ins) are put into “Menu Commands”, etc, etc… Wouldn’t it be much better if we make it look like that?
Here is list of materials about Office ribbon customization (though these are 2 years old and were written for Word 2007 and alike, now they became valid for Visio as well):
Labels: C#, C++, Office 2010, Ribbon, Visio