[Read more…] about Displaying the Master and Stencil Name of Shape
Archives for August 2009
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
Next
‘Close the template document
doc.Close
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
Next
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.
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!
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.