If you are using Case statements to define what is allowed, use a Case Else at the end to define what happens when something other is entered.
-- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP
My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Skrewdriver1979 wrote:
[Quoted Text] > Helpful, but not quite what i am looking for. See below for what i am > running, the string is longer then 256 characters hence the > ActiveDocument.Bookmarks. What i am looking for is if someone fills in > Ontario, Asia, or something other then defined in the macro in the > form field case it will cause an error and/or delete all the > Range.Fields(1).Results.Text. > > Case "AK", "ALASKA" > ActiveDocument.Unprotect Password:="password" > > ActiveDocument.Bookmarks("LLStatesVehicle").Range.Fields(1).Result.Text > = "" > > ActiveDocument.Bookmarks("LLStatesCustomer").Range.Fields(1).Result.Text > = "" > > ActiveDocument.Bookmarks("LLStatesFiling").Range.Fields(1).Result.Text > = "" > > > ActiveDocument.Bookmarks("DaysOut").Range.Fields(1).Result.Text = "" > > ActiveDocument.Bookmarks("Repairs").Range.Fields(1).Result.Text = "" > > > > ActiveDocument.Bookmarks("PeriodMonths").Range.Fields(1).Result.Text > = "" > ActiveDocument.Bookmarks("PeriodMiles").Range.Fields(1).Result.Text = > "" > ActiveDocument.Bookmarks("ContExist").Range.Fields(1).Result.Text = > "" ActiveDocument.Bookmarks("Safety").Range.Fields(1).Result.Text = > "" ActiveDocument.Bookmarks("SafetyTime").Range.Fields(1).Result.Text > = "" > ActiveDocument.Bookmarks("SafetyMiles").Range.Fields(1).Result.Text = > "" ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, > Password:="password"
|