Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Basically what I am trying to do is select values from a list box that were selected before I do a clear without having to manually re-select them
I have tried the below code:
yearSelection = ActiveDocument.Fields("Year").getselectedValues
ActiveDocument.Fields("Year").Fields.Clear
ActiveDocument.Fields("Year").Select yearSelection
Any help would be much appreciated
One way is to save a bookmark as soon as clear button is triggered and then after clear you select that bookmark and delete the templorary bookmark.
There is no trigger on "clear" though, but I remember I replied a solution to one of the forum questions here with a workaround on how to do a "clear trigger". Just search for clear trigger and you should find it.
One way is to save a bookmark as soon as clear button is triggered and then after clear you select that bookmark and delete the templorary bookmark.
There is no trigger on "clear" though, but I remember I replied a solution to one of the forum questions here with a workaround on how to do a "clear trigger". Just search for clear trigger and you should find it.
Thank you Rakesh
For anyone else who would like to know this is the code i have used:
ActiveDocument.CreateDocBookmark true, "Current Selections"
ActiveDocument.Fields("Day").Clear
ActiveDocument.Fields("Year").Clear
ActiveDocument.Fields("Month").Clear
ActiveDocument.RecallDocBookmark "Current Selections"
ActiveDocument.ClearDocBookmarks
In your original example where you wanted to retain the selections for a single field, you could have used:
ActiveDocument.Fields("Class").ClearAllButThis
Gordon