Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I´m Trying to make a macro that selects everything except one tipe of field.
Right now I know if I want to select that one field I have to use:
Sub Reempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
end sub
But I want to select all the other fields but "Reempaque" what do I have to use?
Thanks,
Sub AllOtherThenReempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
ActiveDocument.Fields("Variedad").SelectExcluded
end sub
You can use ToggleSelect to unselect a selected value.
So if you use:
Sub Reempaque
ActiveDocument.Fields("Variedad").SelectAll
ActiveDocument.Fields("Variedad").ToggleSelect("Reempaque")
end sub
Sub AllOtherThenReempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
ActiveDocument.Fields("Variedad").SelectExcluded
end sub
Thanks very much Rakesh and Nmiller, I tried the SelectExcluded option and it does work perfectly!
I tried just this below to create a macro. This selects all items in a the field. However I want to be able to just pick 1 item, any item in that field. However I cannot name a specific one because that will always be different. Any ideas on how to just get it to pick one, maybe the first in the list?
function
{
ActiveDocument.Fields(
"ResidentName").ToggleSelect("*")
}