Const idProp As String = “Prop._VisDM_ID”
Dim pag As Visio.Page
Dim i As Integer
Dim urlOld As String
Dim id As String
Dim urlNew As String
For Each shp In pag.Shapes
If shp.CellExistsU(“Prop.” & urlCell, Visio.visExistsAnywhere) _
And shp.CellExistsU(idProp, Visio.visExistsAnywhere) Then
urlOld = shp.Cells(“Prop.” & urlCell).ResultStr(“”)
id = shp.Cells(idProp).ResultStr(“”)
urlNew = Left(urlOld, Len(urlOld) – 5 – Len(Format(id, “#”))) & “DispForm.aspx?ID=” & Format(id, “#”)
shp.Cells(“Hyperlink.” & urlCell & “.Address”).FormulaU = “=””” & urlNew & “”””
End If
Next shp
Next pag