I have a form that user complete and within that form I have a book mark that after the document is opened VBA nicely fills in the computer name so I can determine which/who completed the form.
All is working fine but if I have to edit the form when its opened the macro runs as it should and places my computer name correctly in the bookmark.
The issue is that when it fills in the bookmark with the computer name the books mark is lost which causes other issues for me not related to this question.
Is there a way to either maintain the bookmark name or recreate with a macro?
Here is my document_open code: (document is protected, no password)
On Error GoTo ErrHandler
ActiveDocument.Bookmarks("computer").Range = Environ$("computername")
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayLeftScrollBar = False
.StyleAreaWidth = InchesToPoints(0)
.DisplayVerticalRuler = True
.DisplayRightRuler = False
.DisplayScreenTips = False
.ShowBookmarks = True
.FieldShading = wdFieldShadingAlways
'MsgBox "Please complete form on computer and email to:" & vbCr & vbCr & _
"email@example.com" & vbCr & vbCr, vbOKOnly, "Order Submission"
Application.DisplayStatusBar = True
Application.ShowWindowsInTaskbar = True
Application.ShowStartupDialog = False
ActiveWindow.EnvelopeVisible = True