Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I use the following script to get all possible values in vb macro
SET Field1 = Doc.Fields("CodeGroupe").GetPossibleValues |
How could I get all values possible and exluded for a field ?
vList:
= concat({1} distinct Total CodeGroupe, ',')
and query them within the macro:
SET Field1 = Doc.Variables("vList").GetContent.String
Or maybe something like
SUB Test
Set field = ActiveDocument.GetField("FieldName")
msgbox( field.GetCardinal )
for i = 1 to field.GetCardinal
msgbox(ActiveDocument.Evaluate("=FieldValue('FieldName',"&i&")"))
next
END SUB
I think the easiest way will be to create these list within a variable in the gui per:
vList:
= concat({1} distinct Total CodeGroupe, ',')
and query them within the macro:
SET Field1 = Doc.Variables("vList").GetContent.String
- Marcus
vList:
= concat({1} distinct Total CodeGroupe, ',')
and query them within the macro:
SET Field1 = Doc.Variables("vList").GetContent.String
how could I loop over each values in the list ?
Or maybe something like
SUB Test
Set field = ActiveDocument.GetField("FieldName")
msgbox( field.GetCardinal )
for i = 1 to field.GetCardinal
msgbox(ActiveDocument.Evaluate("=FieldValue('FieldName',"&i&")"))
next
END SUB
You could create an array from this variable and loop through it, like:
...
arr = split(Field1, ",")
for i = 0 to ubound(arr) - 1
xyz = arr(i)
....
next
....
- Marcus
did a small qvw with a simple macro that works