Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to work with onOpen doucment Event trigger that will run a macro - This macro will select certain fields. I am having an issue to try to find the correct logic or syntax to give me the general outcome I am looking to achieve.
What I'm looking to do: I want to Negate 2 selections ("A" && "B"). So that within my document the current selection object will show the negation == NOT A, B.
## This would select both "A" & "B" on document open.
## But is there syntax like Select Not "A" & "B"?
OnOpen [Event] --triggers--> Run Macro --calls--> Sub openSelections
Sub openSelections
.........
ActiveDocument.Fields("NAME").Select "A"
ActiveDocument.Fields("NAME").ToggleSelect "B"
.........
End Sub
Can anyone assist in the syntax I'm looking for? I am looking for a macro solution to do this.
-Conor F.
Does it have to be a macro? I would advise using just Actions instead of possible.
Select in Field: (A|B)
Select Excluded.
-Rob
Can you just do SelectExcluded after your two lines?
Does it have to be a macro? I would advise using just Actions instead of possible.
Select in Field: (A|B)
Select Excluded.
-Rob
Rob -
I have decided to go your suggested route and make them Actions instead. However the compound select did not work in my case so I applied a toggle select instead. The compound select did not like the searches having multiple word strings like: ('Seller A'|'Buyer A').
My final solution was:
Select in Field: Field = Name; Search = 'A'
Toggle Select: Field = Name; Search = 'B'
Select Excluded: Field = Name
Thanks for your help!
- Conor
m w -
I did something similar in my solution but in a Action instead.
I was unable to get the SelectExcluded to work properly in the macro:
ActiveDocument.Fields("NAME").Select "A"
ActiveDocument.Fields("NAME").ToggleSelect "B"
ActiveDocument.Fields("NAME").SelectExcluded
Maybe I am using the syntax incorrectly?
- Conor