Dim index as integer
Dim Shp As Shape
For index = 1 To ThisDocument.Pages(1).Shapes.Count
Set Shp = ThisDocument.Pages(1).Shapes(index)
If shp.cellexistsU("User.SiteName") = -1 Then
If shp.cellsU("User.SiteName") = "Default" Then
Application.DoCmd (1312)
Else
End If
Else
End IF
Next index
Basically it should look through all the shapes on page 1 and if any have the cell and the cell value = default then it'll open the shape data.
NJB
> On Monday, June 21, 2010 9:50 AM alex burn wrote:
> Hi,
>
>
>
> Please bear in mind that I am very new to VBA.
>
>
>
> I have a template page that I've created.
>
> On this template page I have some (10) custom 'Shape Data' properties set (on the page itself).
>
>
>
> I am trying to create a simple 'On Open' macro that brings up the Shape Data dialogue box, but ONLY IF the custom property "User.SiteName" = "Default".
>
>
>
> So far the only thing I have been able to do is bring up the dialogue box with the use of the following code:-
>
>
>
>
>
> Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
>
> On Error Resume Next
>
> Application.DoCmd (1312)
>
> End Sub
>
>
>
>
>
> However, even the code above has inherent problems. If the focus is taken away from the Visio application whilst the 'Shape Data' dialogue box is open, Visio crashes. All is okay as long as the focus remains on Visio, which is not ideal.
>
>
>
> Can anyone offer any assistance?
>
>
>
> Thanks