Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to select a field with alternate state using a macro

I want to select a field with alternate state using a macro.

The following statement works for the field with default state.

ActiveDocument.Fields("Aisle").Select  "Aisle1",true

I want to extend this to be used with an alternate state called "State1".

I tried the following but no luck so far;

ActiveDocument.Fields("State1::Aisle").Select  "Aisle1",true

ActiveDocument.Fields("{State1}Aisle").Select  "Aisle1",true

Can someone shed some light here pls.?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

...Better late than never.
Either of the below lines should work for you:
ActiveDocument.GetField("Aisle", "State1").Select "Aisle1", True
ActiveDocument.Fields("Aisle", "State1").Select "Aisle1", True

View solution in original post

5 Replies
Anonymous
Not applicable
Author

...Better late than never.
Either of the below lines should work for you:
ActiveDocument.GetField("Aisle", "State1").Select "Aisle1", True
ActiveDocument.Fields("Aisle", "State1").Select "Aisle1", True
Not applicable
Author

Thank you a million times for this mchasse1, it worked.

nathanfurby
Specialist
Specialist

A late thank you mchasse!  Really useful - why they can't put this in the documentation or at least the API Guide is beyond me!!

Anonymous
Not applicable
Author

Thank you Mike.

Out of morbid curiosity, where would one locate this information in documentation??

Not applicable
Author

Thanks Mike, I will be able to sleep tonight now