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)
End Sub

Private Sub Document_PageAdded(ByVal Page As IVPage)
End Sub

Private Sub Document_ShapeAdded(ByVal Shape As IVShape)
End Sub

Private Sub Document_ShapeExitedTextEdit(ByVal Shape As IVShape)
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