I have a protected form in Word. I am trying to write a macro that will (after being unprotected) set certain fields to calculateonexit = true and give them a bookmark name so I can reference them later.
I have tried to change the properties of the fields, but I do not know the field names for it to go to (ex. With Selection.FormFields(1) or With Selection.FormFields("Text1")).
When the form is unprotected the first field I am trying to work with is already highlighted. From there I can tab around and get to the other fields, so knowing the names will not be an issue if I can change the setting for the sselected field. I cannot seem to find a way to change these properties of this field without errors though.
I have tried a few different things. Here is one that I recorded that worked when recording, but will not "play" and work. Thanks for any advice!
.Name = "PartNumber"
.EntryMacro = ""
.ExitMacro = ""
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
.EditType Type:=wdRegularText, Default:="", Format:=""
.Width = 20
.Add Range:=Selection.Range, Name:="PartNumber"
.DefaultSorting = wdSortByName
.ShowHidden = False
.CalculateonExit = True