Displaying the Master and Stencil Name of Shape

A recent newsgroup question asked if it is possible to display the master name and the stencil that a shape originally came from.   Following on from my last post ( Re-opening Default Stencils ), I realised that this is possible  Here’s how (once you have created a reference to the Microsoft Scripting Runtime):

Read the rest of this entry »

Re-opening Default Stencils

A recent newsgroup question asked if it is possible to re-open the default stencils that were originally docked when the drawing was created.    At first, this may seem impossible, but, if the original template is present, then it can be silently opened, the docked stencils noted, then opened docked if they are not already docked.  Here’s how (once you have created a reference to the Microsoft Scripting Runtime):

Public Sub OpenDefaultStencils()

Dim srcDoc As Visio.Document
    Set srcDoc = Visio.ActiveDocument
Dim tmplt As String
    tmplt = srcDoc.Template
    If Len(tmplt) = 0 Then
        Exit Sub
    End If

Dim fs As FileSystemObject
    Set fs = New FileSystemObject
    If fs.FileExists(tmplt) = False Then
        Exit Sub
    End If
Dim doc As Visio.Document
    Set doc = Visio.Application.Documents.OpenEx(tmplt, Visio.visOpenCopy + Visio.visOpenHidden + Visio.visOpenDontList)

Dim aryStens() As String
Dim win As Visio.Window
Dim arySrcStens() As String
Dim winSrc As Visio.Window
    For Each win In Visio.Windows
        If win.Document Is doc Then
            win.DockedStencils aryStens
        ElseIf win.Document Is srcDoc Then
            Set winSrc = win
            winSrc.DockedStencils arySrcStens
        End If
    ‘Close the template document

Dim sten As String
Dim i As Integer
    For i = 0 To UBound(aryStens)
        If aryContains(arySrcStens, aryStens(i)) = False Then
            Visio.Application.Documents.OpenEx aryStens(i), Visio.visOpenRO + Visio.visOpenDocked
        End If
End Sub

Private Function aryContains(ByVal objSten As Variant, ByVal sten As String) As Boolean
Dim aryStens() As String
    aryStens = objSten
Dim i As Integer
    For i = 0 To UBound(aryStens)
        If aryStens(i) = sten Then
            aryContains = True
            Exit Function
        End If
    Next i
    aryContains = False
End Function

Oasis at Wembley

The demise of Michael Jackson had an unforeseen benefit for myself.  When his London concert dates were announced I had joined the thousands of others to the web to order tickets because I knew how much my wife would like to see him.  Due to their ticket ordering website crashing, I ended up with twice as many tickets as I wanted.  After his death, the ticket agency (SeeTickets) were very good at setting up the refund process, however I declined their kind offer to receive the holographic ticket in lieu of my money.  So, I decided to see what other concerts were on offer, and one struck me as being quite interesting … Oasis at Wembley!  Oasis have been one of my (and my wife’s) favourite bands for years, and I had never been to the new Wembley stadium.  Despite my misgiving about being miles from the stage, I decided that this would be a good experience … and I could even take my post-school, pre-Uni son.  Oasis are cool for all generations!  Deep Zoom in Silverlight make it even cooler.

We arrived in the sunshine to see the warm-up acts Reverend and the Makers, The Enemy and Kasabian.

HelloWembley BeenaKryshAwaitOasis
Hello Wembley Beena and Krysh await Oasis


Being early, we had plenty of time to admire the new Wembley Stadium!


Here is the Deep Zoom version : Pre-Oasis Concert

As each act came on, the sound quality got better … maybe it was the extra bodies, but maybe it was because the best amps are reserved for the top of the bill. 


Here is the Deep Zoom version : Oasis Concert

Well, it was a long way from the far goal mouth … but at least there were huge screens either side of the stage so we could be assured it really was the brothers Gallagher down there!

Liam Gallagher giving it large GoodbyeWembley

Liam Gallagher gives it large

Goodbye Wembley


I am the egg man, I am the walrus ….. just thought … Michael Jackson’s estate owns the rights to the Oasis encore.  So, we must have contributed something to Michael Jackson’s kids!  Seeing the Gallaghers live was better than having a hologram of Jacko though.


O365 and SharePoint

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query


Azure Solutions for Office 365, and more...

Rob Fahrni



Life with Visio and other Microsoft Toys!

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people