This code shows how to launch Ms Word from Ms Access.
In a form that shows the record needed,
put a button on the form header to launch the code
the button reads text boxes on the selected record an puts them in word doc.
user selects the record, then clicks the Word button,
Code:
Public Sub btnWord_click()
'***** YOU MUST HAVE THE MS WORD XX.X OBJECT LIBRARY CHECKED in VBE menu, tools, references. *****
Dim objWord As Word.Application
Dim doc As Word.Document
Dim WordHeaderFooter As HeaderFooter
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
Set doc = .Documents.Add
'doc.SaveAs CurrentProject.Path & "\TestDoc.doc"
End With
With objWord.Selection
.Font.Name = "Trebuchet MS"
.Font.Size = 16
.TypeText "Dear, " & txtName
.TypeParagraph
.TypeText "Address: " & txtAddr
.TypeParagraph
.TypeText "this note says you are in " & txtDept
'Add header and footer
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "Header"
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "Footer"
End With
'doc.Save
doc.Activate
Set objWord = Nothing
End Sub