sub SelectOnKeyDateChange ActiveDocument.Fields("InterfaceDate").UnLock() ActiveDocument.Fields("InterfaceDate").Clear() ActiveDocument.Fields("InterfaceDate").Select("<=" & ActiveDocument.Evaluate("=Date(KeyDate)")) ActiveDocument.Fields("InterfaceDate").Lock() end sub sub KeyDateOnOpenDoc set v = ActiveDocument.Variables("KeyDate") v.SetContent ActiveDocument.Evaluate("=today()-1"), true SelectOnKeyDateChange end sub sub DocumentListOnChange set doc = ActiveDocument set obj = doc.Fields("DocumentHeaderText") set input = ActiveDocument.Variables("DocumentList") varArray = input.GetContent.String if trim(varArray) <> "" then varArray = Replace(varArray,chr(10),",") varArray = Replace(varArray,chr(13),",") varValue = split(varArray,",") 'Get a list of values excluded from the current selection obj.SelectExcluded set varSelection = obj.GetSelectedValues j = varSelection.Count 'Add values to the list of excluded values for i=lbound(varValue) to ubound(varValue) if varValue(i) <> "" then varSelection.Add varSelection(j).Text = varValue(i) varSelection(j).IsNumeric = False j = j+1 end if next 'Make a new selection with the extended value list obj.SelectValues varSelection, false, true 'Reverse the selection obj.SelectExcluded end if end sub