Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
joefeyas
Partner - Contributor II
Partner - Contributor II

Cycle a Group that contains an expression

I've been using some vb code similar to below to cycle through my cycle group, however after adding an expression it now blows up on the GetActvieField.Name.

Does anyone know a suggested work around?

sub set_group_field
set gp = ActiveDocument.GetGroup("GroupName")
do while gp.GetActiveField.Name <> "FieldName"
gp.Cycle 1
loop
end sub

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Ok,

I tried different macros...

this expression should work for you:

do while activedocument.evaluate("=GetCurrentField([GroupName])") <> "FIELDNAME"

You can check the possible results with:

msgbox ( activedocument.evaluate("=GetCurrentField([GroupName])"))

The only difference will be that for a calculated dimension, the currentfield will return the whole expression...

Hope this helps this time

Regards,

Erich

View solution in original post

4 Replies
erichshiino
Partner - Master
Partner - Master

I guess it`s returning the expression definition instead of the name you gave to it.

You can use some msgbox( gp.GetActiveField.Name) to check what is going on...

I suggest you create another field on the script if it is possible

Hope this helps,

Erich

joefeyas
Partner - Contributor II
Partner - Contributor II
Author

Erich - I tired that but unfortunately the error is being thrown on the gp.Activefield.Name reference.

erichshiino
Partner - Master
Partner - Master

Ok,

I tried different macros...

this expression should work for you:

do while activedocument.evaluate("=GetCurrentField([GroupName])") <> "FIELDNAME"

You can check the possible results with:

msgbox ( activedocument.evaluate("=GetCurrentField([GroupName])"))

The only difference will be that for a calculated dimension, the currentfield will return the whole expression...

Hope this helps this time

Regards,

Erich

joefeyas
Partner - Contributor II
Partner - Contributor II
Author

That worked perfectly, thanks so much.