J
John
Hi there,
I'm trying to add a custom property to a number of document masters,
however, I'm having trouble with the row reference (visRowProp). Can I
reference it by name (ie "Temperament"), rather than by index? It seems to
set the row name ok using sName, but then falls over when trying to
reference it. (Note I've tried various combinations such as visRowProp &
sName etc. etc. (no laughing please!))
Many 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
End Sub
Private Sub AddCustPropRow(ByRef mstr As Master)
Dim sName As String
Set sName = "Temperament"
With mstr.Shapes.Item(1)
.AddNamedRow visSectionProp, sName, 0
.CellsSRC(visSectionProp, visRowProp, visCustPropLabel).FormulaU =
"""Temperament"""
.CellsSRC(visSectionProp, visRowProp, visCustPropValue).FormulaU =
"""BadTempered"""
End With
End Sub
I'm trying to add a custom property to a number of document masters,
however, I'm having trouble with the row reference (visRowProp). Can I
reference it by name (ie "Temperament"), rather than by index? It seems to
set the row name ok using sName, but then falls over when trying to
reference it. (Note I've tried various combinations such as visRowProp &
sName etc. etc. (no laughing please!))
Many 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
End Sub
Private Sub AddCustPropRow(ByRef mstr As Master)
Dim sName As String
Set sName = "Temperament"
With mstr.Shapes.Item(1)
.AddNamedRow visSectionProp, sName, 0
.CellsSRC(visSectionProp, visRowProp, visCustPropLabel).FormulaU =
"""Temperament"""
.CellsSRC(visSectionProp, visRowProp, visCustPropValue).FormulaU =
"""BadTempered"""
End With
End Sub