Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to select a field in a cycic group in code.
I found this code in an existing discussion:
sub set_group_field
set gp = ActiveDocument.GetGroup("TimeGroup")
do while gp.GetActiveField.Name <> "By Month"
gp.Cycle 1
loop
end sub
When I run the code it errors on the do while line with
Object required: 'gp.GetActiveField'
Any ideas?
That may happen if your dimension in the group is actually a calculated dimension.
You can change your code to:
do while activedocument.evaluate("=GetCurrentField([GroupName])") <> "FIELDNAME"
but instead of a simple string you can get the whole expression. Then, you can use
msgbox ( activedocument.evaluate("=GetCurrentField([GroupName])")) , in the first time to check what is going on.
Regards,
Erich
That may happen if your dimension in the group is actually a calculated dimension.
You can change your code to:
do while activedocument.evaluate("=GetCurrentField([GroupName])") <> "FIELDNAME"
but instead of a simple string you can get the whole expression. Then, you can use
msgbox ( activedocument.evaluate("=GetCurrentField([GroupName])")) , in the first time to check what is going on.
Regards,
Erich
Your code works fine for me, check that the group name is correct, specially the case letters.