I have a very simple form in Word 2007 that users enter data that is put on a Word document. In some instances users want the form to be filled out manually and have requested a checkbox on the userform to allow them to just print the document rather than fill our the form.
I have attached a sample with just two textboxes and the one checkbox needed.
Appreciate any help you can provide.
Dim oMyForm As frmName_and_Date
Dim oDoc As Document
Dim sDeponentName As String
Dim sDate As String
Set oDoc = ActiveDocument
Set oMyForm = New frmName_and_Date
.Tag = "CANCEL"
sDeponentName = .txtDeponentName.Text
sDate = .txtDate.Text
Set oMyForm = Nothing
CompleteBookmark sDeponentName, "Deponentname", oDoc
CompleteBookmark sDate, "Date", oDoc
Set oDoc = Nothing
Private Sub CompleteBookmark(theText As String, BookmarkName As String, oDoc As Document)
Dim rngBookmark As Range
If ActiveDocument.Bookmarks.Exists(BookmarkName) Then
Set rngBookmark = ActiveDocument.Bookmarks(BookmarkName).Range
rngBookmark.Text = theText
oDoc.Bookmarks.Add BookmarkName, rngBookmark
Else: MsgBox ("The template is missing the" & BookmarkName _
& "bookmark." & vbCr & vbCr _
& "Either the template is corrupted or someone" & _
"has edited it and removed the bookmark.")
Set rngBookmark = Nothing