J
John
Hi,
Following June's help last week, I'm now at the next stage of trying to
update the shape instances of a master that I've added a new custom property
to. But how should I go about this? (NB the "Match master by name on drop"
check box is checked)
Thanks
John
Sub AddMasterProps()
Dim mstr As Master
For Each mstr In ActiveDocument.Masters
Select Case mstr.Name
Case "Dog"
Case "Cat"
Call AddCustPropRow(mstr)
Case "Mouse"
Case Else
End Select
Next mstr
End Sub
Private Sub AddCustPropRow(ByRef mstr As Master)
Dim sName As String
Dim strRowRef As String
sName = "Temperament"
strRowRef = "Prop." & sName
mstr.Shapes.Item(1).AddNamedRow visSectionProp, sName, 0
rwIndx = mstr.Shapes.Item(1).Cells(strRowRef).Row
With mstr.Shapes.Item(1)
.CellsSRC(visSectionProp, rwIndx, visCustPropsLabel).FormulaU =
"""Temperament"""
.CellsSRC(visSectionProp, rwIndx, visCustPropsValue).FormulaU =
"""BadTempered"""
End With
'Add some form of update shapes
End Sub
Following June's help last week, I'm now at the next stage of trying to
update the shape instances of a master that I've added a new custom property
to. But how should I go about this? (NB the "Match master by name on drop"
check box is checked)
Thanks
John
Sub AddMasterProps()
Dim mstr As Master
For Each mstr In ActiveDocument.Masters
Select Case mstr.Name
Case "Dog"
Case "Cat"
Call AddCustPropRow(mstr)
Case "Mouse"
Case Else
End Select
Next mstr
End Sub
Private Sub AddCustPropRow(ByRef mstr As Master)
Dim sName As String
Dim strRowRef As String
sName = "Temperament"
strRowRef = "Prop." & sName
mstr.Shapes.Item(1).AddNamedRow visSectionProp, sName, 0
rwIndx = mstr.Shapes.Item(1).Cells(strRowRef).Row
With mstr.Shapes.Item(1)
.CellsSRC(visSectionProp, rwIndx, visCustPropsLabel).FormulaU =
"""Temperament"""
.CellsSRC(visSectionProp, rwIndx, visCustPropsValue).FormulaU =
"""BadTempered"""
End With
'Add some form of update shapes
End Sub