• Categories

  • Archives

  • Subscribe

  • Meta

Archive for the 'Code' Category


Save Time & Simplify Your VBA Code With CallByName

Posted by Visio Guy on 23rd June 2008 - 435 views

Read Full Article VBA in Visio is great for learning, prototyping and getting repetitive tasks done quickly. One problem I run into--when I’m not careful—is bloated code resulting from the copying and pasting of too many loops. But with the CallByName function in VBA, we can streamline our code! Read the rest of this entry »

Posted in Code | 1 Comment »

European Cup 2008 Auto-Updating Visio Diagram (v2)

Posted by Visio Guy on 21st June 2008 - 481 views

Read Full Article

UPDATE!

Hey football/soccer fans! We've got an update to our automated smart drawing for this years European Cup soccer tournament.

Perhaps you are familiar with the first version, which can be found here: European Cup 2008 Auto-Updating Diagram

Well, that version needed a few updates, most notably, the handling of games that are resolved with penalty-kicks, or shoot-outs.

Read the rest of this entry »

Posted in Code, Drawings & Templates, Maps & Geography, ShapeSheet, Shapes | 2 Comments »

European Cup 2008 Auto-Updating Visio Diagram

Posted by Visio Guy on 9th June 2008 - 1826 views

Read Full Article

Visio is a natural choice for creating brackets for sports tournaments.

I have seen many elimination-tournament diagrams created in Visio over the years. In fact, just a few years ago, a very nice example was done for the 2006 World Cup. You can get it at Office Online here: 2006 World Cup Bracket.

But the trouble with these diagrams is that they require *gasp* manual input of data, or user-movement of shapes. The horror!

Well this year, that is all going to change...

Read the rest of this entry »

Posted in Code, Drawings & Templates, Maps & Geography, ShapeSheet, Shapes | 22 Comments »

Detect Sub-selected Shapes Programmatically

Posted by Visio Guy on 17th May 2008 - 545 views

Read Full Article

A coding problem that Visio developers often stumble upon recently reared its ugly head yet again in the newsgroups. The question, very simply, was:

How do you programmatically detect sub-selected shapes?

The usual place to start is with a simple line of code, like:

Visio.ActiveWindow.Selection

But as it turns out, this line surprisingly does not return sub-selected shapes. So let's dig deeper into the problem so that you can get your projects finished!

Read the rest of this entry »

Posted in Code | 2 Comments »

Understanding Arc-Resize Problems in Visio

Posted by Visio Guy on 28th April 2008 - 871 views

Read Full ArticleIf you've ever drawn arcs in Visio, then grouped them together with other shapes, you may have noticed that they behave rather oddly on resizing. As you make the group bigger or smaller, the arcs may bow or squish in ways that you didn't expect.

This problem arises because of the interaction style of the arc shapes, which is 1D. Visio has two interaction styles: 1D and 2D. They have to do with the green handles you see on the shape, and how you go about manipulating the shape with the mouse.

In this article, we'll describe the difference between the two interaction styles, and explain how to correct resizing problems you might be encountering.

Read the rest of this entry »

Posted in Code, Power User, ShapeSheet | 2 Comments »

Connect All Shapes to Each Other

Posted by Visio Guy on 17th March 2008 - 1504 views

Read Full ArticleIf you're a developer, looking to create Visio-based solutions, then you're going to need to programmatically connect Visio shapes together. Wouldn't be nice to have a snippet or two to start from?

Today's post shows you VB and C# code that instructs Visio to connect every shape to every other shape, and to create a beautiful mess, like that shown in the image at left.

Read the rest of this entry »

Posted in Code, Development | 7 Comments »

Edit Visio Masters Programmatically…the Right Way!

Posted by Visio Guy on 25th February 2008 - 1904 views

Read Full Article

If you are busy developing a Visio solution, you might run into the situation where you need to edit a Visio master using code.

Like any application that has survived the ages, Visio has its share black-magic techniques that lurk in dusky corners of the netherworld. And if you need to edit masters programmatically, be warned! You're heading down a dark alley...

If you've already run into problems with this, don't feel bad. Even experienced Visio developers get tripped-up by this one! And that's because the correct way to do this isn't obvious, and the obvious way to do it isn't correct!

Read the rest of this entry »

Posted in Code, Development | 12 Comments »

Circular Text Generator (version 2)

Posted by Visio Guy on 5th January 2008 - 3830 views

Circular Text Generator (version 2)

Getting text on a circle in Visio was always a pain until the Circular Text Generator (version 1) appeared on Visio Guy. V1 was evidently a big hit, but you wanted more! Version 2 adds some more control over text spacing and placement on the circle. So if you need to place Visio text on a circle, read on!

Read the rest of this entry »

Posted in Add-ins & Tools, Code, Illustration, ShapeSheet, Shapes | 7 Comments »

Text to the Bottom of the Shape

Posted by Visio Guy on 7th November 2007 - 2116 views

Read Full ArticleA Visio newsgrouper recently pointed out that in Visio, inserted images have a different default text position than normal shapes. For images, the text is located at the bottom of the shape, and text "grows" downward.

This makes sense, since you usually don't want the text to obscure the image. But perhaps you shape developers out there in Internet Land might wish to have the same text behavior for your shapes!

In this article, we'll discuss how to do it by hand, and offer some VBA script to get the job done faster!

Read the rest of this entry »

Posted in Code, Development, ShapeSheet | 1 Comment »

LengthIU Bug Workaround Code

Posted by Visio Guy on 20th October 2007 - 1384 views

Read Full Article

Visio 2003 has a defect in the LengthIU property of a Shape object. This article discusses the bug, describes a work-around, and offers Visual Basic code to help you get back on track!

Read the rest of this entry »

Posted in Code, Limitations & Bugs | 6 Comments »

Circular Text Generator (version 1)

Posted by Visio Guy on 18th October 2007 - 4784 views

Read Full ArticleOK, we've just about had enough! Between all the newsgroup posts, and John Marshall's nagging, it's time to do something about adding text to a circle in Visio. 'Til now, the standard response has been; "insert a Word Art object". But with Visio's SmartShape- and automation capabilities that just won't do! We ought to be able to build something cool--and more native to Visio. This article presents the first in a series of the Circular Text Generator! Read the rest of this entry »

Posted in Code, Illustration, ShapeSheet, Shapes | 20 Comments »

Customized Visio HTML Export

Posted by Visio Guy on 24th August 2007 - 4225 views

Read Full ArticleA recent Visio newsgroup post asked about customizing the output files from Visio's Save As Web feature. This rang a bell in the ol' noggin, and I went searching for an old demo that exported a customized html page, with pop-up menus that displayed Custom Property (Shape Data) information.

Read the rest of this entry »

Posted in Code, Development, Drawings & Templates | 9 Comments »

Sales Force Automation With Visio

Posted by Visio Guy on 3rd June 2007 - 3345 views

Read Full ArticleOne of the areas in which Visio particularly shines is that of Sales Force Automation. With Visio, a rep can sit on-site with a customer, and visually spec out a system or an installation. The components in the Visio schematic can be linked to real product-data, and can be analyzed via code to generate bills-of-material and reports automatically.

On MSDN, I recently uncovered "oldie but goody" demo that shows off these capabilities. I created it for Visio 5.0, while I still worked for Visio Corp, and it still works with Visio 2003! The demo illustrates how a fictitious candy-manufacturing line might be laid out. Custom shapes represent general classes of equipment, and database links behind the shapes specify real-world items. With the click of a button, a Bill of Materials, is generated in an embedded Excel spreadsheet, sitting right on the page!

Read the rest of this entry »

Posted in Code, Shapes | 9 Comments »

Run VBA Code When Documents Open

Posted by Visio Guy on 25th May 2007 - 2510 views

Read Full ArticleIf you've dabbled with the VBA project that resides in Visio documents, then you've likely stumbled upon the Document object's DocumentOpened event. This is a great place for running any initialization code that you might require, but there's a better way...

Read the rest of this entry »

Posted in Code | 2 Comments »

VBA Macro Security

Posted by Visio Guy on 17th May 2007 - 4238 views

Read Full ArticleMacro security is an important topic for anyone who deals with automated Microsoft Office solutions. Since Visio and other Office documents can contain Visual Basic code that can perform potentially harmful operations, you need to understand a little bit about how to secure your system.

This article will inform you about the various security settings available forVisio 2003 and Visio 2007, so that you can more confidently enjoy the downloads and code samples that you'll find on Visio guy.

Read the rest of this entry »

Posted in Code | 10 Comments »

Integrating Visio 2007 with Microsoft Technologies

Posted by Visio Guy on 11th May 2007 - 1941 views

Visio 2007 IntegrationIn your quest to create a Visio-based application you're not likely to find yourself stranded on a Visio-based-island. You'll probably find yourself strolling through a land filled with other software products that need to join you on your journey.

So if your wanderings take you through the towns of Access, Excel, Active Directory, SQL Server, MOM, Exchange, Reporting Services, or SharePoint, then you've stopped at the right place to get directions!

The good citizens at Visimation have authored eight -- that's E-I-G-H-T-! -- articles to guide you on your path towards integrating Visio with Microsoft technologies...

Read the rest of this entry »

Posted in Beyond Visio, Code, Visio 2007 | No Comments »

Data Graphics Resources

Posted by Visio Guy on 4th May 2007 - 2644 views

Read Full ArticleVisio 2007 has many cool new features, and among the coolest are Data Linking and Data Graphics. These data features allow shapes to link to data-sources and graphically react to it. You can also add Data Callouts as adornments to existing shapes. The callouts display data next to a shape without visually changing the actual shape.

Of course, if you're a Visio Guy like me, you won't be content to sit back and use the pre-built Data Graphics supplied by The Man. You'll want to roll up your sleeves and create your own, thank you very much.

So I've scoured the net to find resources that contain the nitty-gritties about Data Graphics. Have a look, and stay up all night!

Read the rest of this entry »

Posted in Code, Data, ShapeSheet | 10 Comments »

Visio 2007 Demo Videos

Posted by Visio Guy on 10th April 2007 - 2199 views

Read Full Article

Hello Visio Fans! I received a Visio Partner e-mail a few days ago that contains a fabulous set of links to Visio How-To demo videos. The demos cover new Visio 2007 topics such as DataGraphics, Themes, AutoConnect, PivotDiagrams and Vista integration.

Read the rest of this entry »

Posted in Code, Visio 2007 | 5 Comments »

Visio and Xml Conference Resources

Posted by Visio Guy on 30th November 2006 - 1297 views

Read Full ArticleBack in January 2006, I made a presentation at the Microsoft Office Visio Conference in Home-Sweet-Home Seattle. Good company, good information, and good fun was had by all! You can download plenty of excellent content from that conference, including PowerPoint slides and recorded presentations. Get it here: Visio Conference web site.

In my presentation, Working With Visio an Xml, our friend, Dr. Xml, proudly made his PowerPoint debut and won the crowd over. The presentation summary was...

Read the rest of this entry »

Posted in Code, Events | 9 Comments »

Polyline Shape Maker

Posted by Visio Guy on 27th November 2006 - 2010 views

Read Full ArticleSometimes your Visio SmartShapes can be like beauty pageant contestants: they just need to look good, but don't need a lot of intelligence. The creators of Visio realized this (after five versions) and gave us a way to streamline lots of "dumb" vector data. The ShapeSheet function: POLYLINE and the geomettry row: PolyLineTo will help you get the job done.

Read the rest of this entry »

Posted in Code, ShapeSheet | 3 Comments »

Polygon Maker

Posted by Visio Guy on 24th November 2006 - 1954 views

Read Full Article

Another question popped up on the newsgroup forums today asking about making polygon shapes in Visio. This triggered a neuron, and I was off like a flash to perform a search of my ...\Visio directory.

Sure enough, I found "PolygonMaker 2002.vsd", which I have prettied-up for presentation to you today...

Read the rest of this entry »

Posted in Code, Shapes | 1 Comment »

Combo Box Table of Contents

Posted by Visio Guy on 8th November 2006 - 1603 views

Read Full Article

Yet another newsgroup post caught my eye today. I'm not sure if I answered the guy's actual question, but I had fun creating this example anyway.

Today's sample shows you how to create a table of contents. This particular version lists the pages in a Visio document in a drop-down combo box that sits on a Visio page. Just select an item from the list, and Voila! You are sent to the corresponding page in the document!

Read the rest of this entry »

Posted in Code | 3 Comments »

Visio 2007 Developer Resources #1

Posted by Visio Guy on 3rd November 2006 - 2439 views

Read Full ArticleWell the buzz about Visio 2007 is increasing daily, and all the hard-core Visio fans are already working on solutions for the next version of Visio. If you're itching to jump on the bandwagon, I've collected a set of links to point you towards as many Visio 2007 developer-related links as possible!

Enjoy!

Read the rest of this entry »

Posted in Code, ShapeSheet | 6 Comments »

Visio Snowflake Generator

Posted by Visio Guy on 2nd November 2006 - 2657 views

Read Full ArticleWell folks, it's snowing here at Visio Guy Headquartes in Munich! So I guess it's time to start thinking winter after all. And that's just what this article and download are all about: Winter! Visio and Winter! Visio and Winter and Snowflakes!

So let's forget about BPM, Org Charts and Network Diagrams for a while, and hark back to the winters of our youth, when we'd busily be folding paper and cutting away triangular bits, in the mad pursuit to decorate our windows with paper snowflakes.

I've coddled together a little tutorial that shows you how to use Visio's Fragment, Union, Combine and Trim functions to create snowflakes -- “ just like you did back in kindergarten! And the download contains some Visual Basic for Applications code to help you "do the unfolding" automatically!

Read the rest of this entry »

Posted in Code, Seasonal, Shapes | 3 Comments »

Export All Pages in Document

Posted by Visio Guy on 18th September 2006 - 1897 views

Every once in a while, a question comes along in the newsgroups that just screams at me; "WRITE SOME SAMPLE CODE!" Now I can't describe exactly which types of questions speak to me in this way. Perhaps they're questions I've heard time and again? Or they involve a fascinating graphical problem? Or is it just that I can actually finish them in one evening's work?Whatever the reason, the latest question is; "How do I export all of the pages in a Visio document to image files?"

Read the rest of this entry »

Posted in Code | 3 Comments »

Create Visio Flowcharts Programmatically

Posted by Visio Guy on 13th September 2006 - 7190 views

Read Full ArticleI hear quite often the question; "How do I do something in Visio programmatically?" Since many of those requests pertain to flowcharts and organizational charts, I thought I'd conjure up a fairly simple example that illustrates the creation of a flowchart with Visual Basic for Applications (VBA) code.

This isn't the simplest example, because I thought it would be important to show how a decision-branch might be handled.

Read the rest of this entry »

Posted in Code | 26 Comments »

The Hidden World of Visio Shapes

Posted by Visio Guy on 5th September 2006 - 4541 views

So you've created beautiful graphics in Visio, and you know how to add phantasmal ShapeSheet smarts to your shapes, now its time for you to make it all disappear! I often get asked how to toggle the visibility of various elements of Visio drawings, and I usually offer up one of many solutions. But I don't think that those many solutions have ever been cataloged in a single place. Until, of course, now...

Read the rest of this entry »

Posted in Code, ShapeSheet | 26 Comments »

  • Tag Cloud

  • Recent Comments on Visio Guy

  • RSS The Latest from the Visio Guy Forum

  •