Thank you Paul, Jumpy and John!
That helped very much, however I want to make this work in conjunction with my recorded macro and all I seem to be successful modifying is the first shape, even after changing the macro to loop.
John I went to your very helpful website and tried 2 different modifications to my code using yours, but they didn't yield the desired result. I would appreciate any tips you can give me on either of the 2 codes, thank you.
First Code:
Sub Macro1()
Dim pag As Page
Dim shp As Shape
'Set reference to correct page
Set pag = Application.ActivePage
'Run through all shapes on the page
For Each shp In pag.Shapes
'Enable diagram services
Dim DiagramServices As Integer
DiagramServices = ActiveDocument.DiagramServicesEnabled
ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Shape Data")
Dim vsoShape1 As Visio.Shape
Dim intPropRow2 As Integer
Set vsoShape1 = Application.ActiveWindow.Page.Shapes.ItemFromID(1)
intPropRow2 = 1
vsoShape1.CellsSRC(visSectionProp, intPropRow2, visCustPropsType).FormulaU = "0"
vsoShape1.CellsSRC(visSectionProp, intPropRow2, visCustPropsFormat).FormulaU = """@+"""
Application.EndUndoScope UndoScopeID1, True
'Restore diagram services
ActiveDocument.DiagramServicesEnabled = DiagramServices
Next shp
End Sub
Second Code:
Sub Macro1()
Dim pag As Page
Dim shp As Shape
Dim i As Integer
Dim iStart As Integer
Dim iEnd As Integer
'Set reference to correct page
Set pag = Application.ActivePage
'Run through all shapes on the page
iStart = pag.Shapes.Count
iEnd = pag.Shapes.Count
For i = iStart To iEnd
Set shp = pag.Shapes.ItemU(i)
'Enable diagram services
Dim DiagramServices As Integer
DiagramServices = ActiveDocument.DiagramServicesEnabled
ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Shape Data")
Dim vsoShape1 As Visio.Shape
Dim intPropRow2 As Integer
Set vsoShape1 = Application.ActiveWindow.Page.Shapes.ItemFromID(1)
intPropRow2 = 1
vsoShape1.CellsSRC(visSectionProp, intPropRow2, visCustPropsType).FormulaU = "0"
vsoShape1.CellsSRC(visSectionProp, intPropRow2, visCustPropsFormat).FormulaU = """@+"""
Application.EndUndoScope UndoScopeID1, True
'Restore diagram services
ActiveDocument.DiagramServicesEnabled = DiagramServices
Next i
End Sub