Reference row by name

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
 
J

junethesecond

How would you like to use Cells.Row property?
Foe example...
Indx = vsoShape.Cells("Prop.Temperament").Row
vsoShape.CellsSRC(visSectionProp, Indx, visCustPropsLabel).Fromula =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top