At its most basic - lets assume a userform with three text boxes and a command button. Add the following to an ordinary module in the template. This will look at the bookmarks in the document and will fill the named form text boxes with the values of the three named bookmarks. When the command button is clicked the text box values are written back to the bookmarks.
Option Explicit
Sub ProcessForm()
Dim ofrm As New UserForm1
Dim oBm As Bookmark
With ofrm
For Each oBm In ActiveDocument.Bookmarks
Select Case oBm.Name
Case "bm1": .TextBox1.Text = oBm.Range.Text
Case "bm2": .TextBox2.Text = oBm.Range.Text
Case "bm3": .TextBox3.Text = oBm.Range.Text
End Select
Next oBm
.Show
If .Tag = 1 Then
FillBM "bm1", .TextBox1.Text
FillBM "bm2", .TextBox2.Text
FillBM "bm3", .TextBox3.Text
End If
End With
Unload ofrm
lbl_Exit:
Set ofrm = Nothing
Set oBm = Nothing
Exit Sub
End Sub
Private Sub FillBM(strBMName As String, strValue As String)
Dim oRng As Range
With ActiveDocument
On Error GoTo lbl_Exit
Set oRng = .Bookmarks(strBMName).Range
oRng.Text = strValue
oRng.Bookmarks.Add strBMName
End With
lbl_Exit:
Set oRng = Nothing
Exit Sub
End Sub
The command button code will be
Private Sub CommandButton1_Click()
Me.Hide
Me.Tag = 1
lbl_Exit:
Exit Sub
End Sub
You can call the main macro 'ProcessForm' from both a Document_Open and a Document_New macro (and a button on the QAT or ribbon also if you wish).
If the bookmarks don't exist nothing will happen to the document or form in respect of the missing bookmark(s).