Category Archives: 11313

Non Standard Timelines

One of the long time requests for the Visio timeline is to support something other than standard dates and times. Items that are not related to the standard concept of time.

This can be accomplished by NOT using date formats in the shapes. Each shape is grouped and has a top level shape that contains a User Property (or two) of the form User.xxxMask that contains the format to be used for the dates or times. This is controlled by the Timeline menu, but the format can be changed to use something more generic.

Dates are internally represented by a floating point number with the decimal portion representing the time of day. So to get a generic numeric date, the format has to be changed so the “date” is displayed as a number. This can be done by editing each shape OR editing the masters on the stencil. Of course, the standard caveat applies. Backup the masters! A better solution is to create a copy of the stencil and apply the modifications to it.

So modify the masters so the User.xxxMask cells contain “n” rather than {{M/d/yyyy}}.

 

Where is Waldo?

With Visio 2010, Visio has now joined the other core Office apps and now supports the ribbon. With the old menus, I ended up turning almost all of them on and wasting screen real estate. So in a way, I like the new ribbon. Of course, the first question asked always starts with, “where is the button for…”. There is a download from Microsoft that will help you navigate, but the Visio team was prepared for questions about the location of commands. If you click on the File Ribbon and choose Options and then Customize ribbon, you are presented with choices for changing the ribbon. In the drop down box below “choose commands from: “ select “All Commands”. Now if you scroll down the list of commands, you should be able to find the command you are looking for. If you hover over the command, you will be presented with the actual location of the command on the ribbon. If you start from the top of the list, do not get discouraged, the first none commands are “Not in the Ribbon”

Don’t forget to check out the forums for free help with your questions. If the volume of questions is sufficient in the Answers forum, may be w will get a forum to ourselves rather than sharing with Access, Project and InfoPath.

Review of David Parker’s new book

Visio is almost twenty years old and for the last few versions, Microsoft has been extending Visio’s capabilities beyond being the standard for drag and drop diagramming applications. In the beginning, Visio lead the way with it’s ability to quickly create business diagrams with intelligent shapes. Rather than worrying about the details of drawing shapes, the user could concentrate on how the shapes interacted. With Visio 2010, Microsoft laid the groundwork for validating the diagrams. As a new feature, Microsoft made sure that the validation process was well defined, but only created basic rule sets.

With this book, “Microsoft Visio 2010 – Business Process Diagramming and Validation”, my fellow Visio MVP, David Parker has explained how the new validation feature works and provided tools for analysing and creating your own rules. This is more than a rehash of Microsoft documentation, he has worked with the people who created the validation feature to make sure the book contains a good overview of the rule creation process so that anyone can create their own validation rules. The book walks you through the creation of some dot net programs to analyse rule sets and other programs for actually implementing some of the rules. It also provides some good background into the Visio object model and the Visio Shapesheet so that developers new to Visio are not totally lost. The examples David provides make a good starting point for rule developers.

The 314 pages of this book are well written and provide a good insight into a new and very useful feature of Visio 2010. Microsoft will be embellishing this feature in future versions, but for those who can not wait and need to create their own rules, this is the book.

Using Custom Property Lists

When you have a shape with a Custom Property/Shape Data List you may want to refer to it from within the shapesheet or an associated shapesheet. The first inclination would be to do a string comparison within the test. My preference is to create a User cell that uses Lookup to convert the text into a numeric value.

So for a list named Relation, the Shape Data row would be:
Name:   Prop.Relation
Type:   1
Format:   “Hostile;Close;Distant”  
Value:   =INDEX(1,Prop.Relation.Format)

So what would be in the Value of the User Property cell User.Relation_nbr? The LOOKUP function would need the string to search for (which is conveniently located in Prop.Relation) and a list to search through. The Shape Data conveniently provides that in the Format cell. So the newly created User Property cell would be.
Name:   User.Relation_nbr
Value:   Lookup(Prop.Relation,Prop.Relation.Format)

So there is no chance the comparison will be done against a misspelled text string because all that information is contained within the Shape Data row and all the comparisons will be numeric. If you do need the chosen text from the list, then you can use the Shape data value.

I am working on a set of Genogram shapes and the various shapes require text the use can understand, but the shapesheet is easier when it deals with numeric values.

 

I Need Help!

This month, the Microsoft newsgroups were closed, but there were no clear cut direction for continued support. Other than announcements of their closing, little effort appears to have been done to highlight the new forums as the place to go for Visio support.

In the place of the thirteen Visio newsgroups, Microsoft has provided three forums:

http://social.technet.microsoft.com/Forums/en-CA/visiogeneral/threads

http://social.msdn.microsoft.com/Forums/en-US/visiogeneral/threads

http://social.answers.microsoft.com/Forums/en-us/addbuz/threads

There is no clear cut definition as to which one to use, but it appears that they are for general user questions and not for Visio developers. On the Answers forum, the Visio questions are buried in a forum shared with other Office products. Compared to the newsgroups, the volume of traffic is way down. Whether that is due to people having a hard time finding the forums or that the forums do not appear to be as easy to use as the former newsgroups is hard to tell. With the old newsgroups, it was easy to see the new posts and what has been read.

There is also a Microsoft forum for VSTO for some of the Visio questions, http://social.msdn.microsoft.com/Forums/en-US/vsto/threads, but there does not appear to be a forum for developers using VBA or creating shapes.

Only time will tell whether the Microsoft replacement to the newsgroups will adequately support the Visio community.

So what other Q&A resources are available for Visio users?

  • 1. Fellow MVP, Chris Roth, has an excellent forum at his Visio Guy website. http://www.visguy.com/vgforum/
  • 2. Visimation did have forums, but they are now closed.
  • 3. Tek-Tips have had a Visio forum for a while, but traffic is very low. To give you an idea of how low, I am the top poster and I only have ten votes. In other forums, the top poster has several thousand votes. http://www.tek-tips.com/threadminder.cfm?pid=172

 

How do I change skin colour?

I have a few Google alerts set up to let me know if the word Visio is mentioned on the internet. I am always interested in new stencils for Visio and this has proven an effective way of finding them. Most of the time, the hit has nothing to do with the product Visio or it was a link to a download site for Visio or one of the books written about Visio. Today was slightly different, there was a link to a blog that said “In Visio 2007, i want to change skin color, but I don’t know the formula’s – does anybody know?”, but no answer.

Thanks to the Visio devs, it is quite easy (almost). They were nice enough to provide a User cell (similar to a custom property/shape data, but hidden) called User.SkinColor where you can set the skin colour. For the Accounting shape in the Workflow stencil of Visio 2007, that value is HSL(21,165,128). HSL stands for Hue, Saturation and Luminesance and is a similar means for setting a colour as RGB.

Of course, the tricky bit is working out what HSL values correspond to different skin tones and assigning a politcally correct name to it. I can understand why the Visio devs would not want to spend days arguing over the correct skin tone of someone from Redmond.

The use of the HSL function is a good choice because it provides a good range of skin tones by just modifying the value for luminesance. So it would be possible to create a simple piece of VBA code to display a slider that would change the user cell User,SkinColor of the selected shape (or shapes) from a value from 0 to 240.

 John… Visio MVP

Revision Dates per Page

One of the posters in the newsgroup was asking about providing a revision date on each page of a Visio document and this is what I came up with. The only dates that are associated with a Visio drawing are done at the document level, so another apporach is necessary.

To create a date stamp at the page level, add a custom property/Shape Data to the pagesheet for each page. This property can then be changed automatically when the page is altered. Since the property is updated automatically, the property will also be created if it does not exist.

Private Sub Document_BeforeSelectionDelete(ByVal Selection As IVSelection)
UpdateDateReviewed
End Sub

Private Sub Document_PageAdded(ByVal Page As IVPage)
UpdateDateReviewed
End Sub

Private Sub Document_ShapeAdded(ByVal Shape As IVShape)
UpdateDateReviewed
End Sub

Private Sub Document_ShapeExitedTextEdit(ByVal Shape As IVShape)
UpdateDateReviewed
End Sub

Sub UpdateDateReviewed()

Dim vsoShape As Visio.Shape
Dim intPropRow As Integer

Set vsoShape = ActivePage.PageSheet

If vsoShape.CellExists(“Prop.DateRevised”, False) = False Then
    intPropRow = vsoShape.AddRow(visSectionProp, visRowLast, visTagDefault)
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsLabel).FormulaU = “””DateRevised”””
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsValue).RowNameU = “DateRevised”
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsType).FormulaU = “5”
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsFormat).FormulaU = “”
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsPrompt).FormulaU = “”
    vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsValue).FormulaU = “”
   
End If

vsoShape.Cells(“Prop.DateRevised”) = Format(Now(), “00000.00000”)

End Sub

 

From Adobe Illustrator to Visio

One thing that got me hooked on Visio from the beginning was that you were not limited to the shapes that were supplied by the product, You could create shapes from scratch, modify existing shapes or wrap an image from any source into a Visio shape. So, I am always on the hunt for new shapes that are available on the internet.

Recently, I came across a set of well made shapes and was able to get in touch with the creator. Though the shapes looked good, they did not have any of the smarts that can be associated with Visio shapes. The Visio shapes were just foreign images that could not be changed or coloured. The shapes were originally created in Adobe Illustrator and imported into Visio. I tried using other export options from Illustrator, but none allowed me to ungroup the shapes in Visio so the shape can be disected into individual elements that be recombined.

Thanks to Enric Mañas, a PowerPoint MVP, I found out that it is possible to disect the shape by using PowerPoint. The file needs to be first saved as an EPS in Illustrator. The EPS file is then inserted into a new PowerPoint slide and then saved as a WMF file. The WMF file is then inserted in to a Visio drawing and this new shape can then be ungrouped.

So if you need to manipulate a shape created in Adobe Illustrator, use PowerPoint to convert an EPS file to a WMF file.

Multiple copies while Duplex printing

Visio has a problem with duplex printing.

If you ask for multiple copies while duplex printing, you only get one copy. This is rather annoying, but the problem is not with duplex printing. The issue is with the collate option. You can duplex print a Visio document and request mutiple copies and your document will print the correct number of pages, only if you do not select collate. Of course, the pile of paper generated is useless. What is printed on the front and back of the first piece of paper is two copies of page 1.

There is a knowledge based article http://support.microsoft.com/kb/924114 but that indicates that the issue is that collate is not checked. The only workable solution is to set the copies to 1. Sounds like a Henry Ford answer.  You can get any colour you like, as long as it is black. You can print as many copies as you like as long as the number of copies is 1.

Update: This is fixed in Visio 2010 (almost). Though the printing is correct, it appears that you get an extra page if you duplex a document with an odd number of pages. An even number of pages prints fine with no extra page.