I am slowly putting together a routine that opens a Word doc and fills some bookmarks, all fine so far. What I would like to do next is 1. to insert an Existing word document into the active document using a file location that I can control, so would like it to go after bookmarks and before End With in code below. 2. Ideally I would also like to set a Word password in the line that sAVES the document, again I am in control of that password which will be sitting in a form field.
Public Sub OutPutToWord()
Dim Wrd As Object
Set Wrd = CreateObject("Word.Application")
Dim strDocPath As String
strDocPath = Forms![frmEmployeeHome]![SelectedDocument]
Wrd.Visible = True
'Open the Document
.Item("CompanyName").Range.Text = Forms![frmEmployeeHome]![CompanyName]
.Item("OrderDate").Range.Text = Forms![frmEmployeeHome]![OrderDate]
.Item("Address").Range.Text = Forms![frmEmployeeHome]![Address]
1. NEED TO INSERT A WORD FILE IN HERE THAT WILL = Forms![frmEmployeeHome]![InsertDocument]
'Close and release Word pointers
2. WOULD LIKE THIS DOCUMENT TO BE SAVED WITH A PASSWORD FROM AN EXISTING FORM FIELD.
Set doc = Nothing