Yes you can paste this code to the OnClick event of the button, just change
the name of the Doc File.
If you get any error, post the code you are using and specify how do you get
the name of the Document

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> With either method above, where do I start - do I paste code somewhere or is
> there a wizard of some kind?
[quoted text clipped - 14 lines]
> > >
> > > John
jmuirman - 31 Oct 2005 16:38 GMT
I got several messages - I probably pasted in the wrong spot - here's the code:
End Sub
Private Sub Command76_Click()
On Error GoTo Err_Command76_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FNewCases-BY CLAIMANT"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command76_Click:
Exit Sub
Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click
End Sub
Private Sub Command77_Click()
Function Open_WordDoc(C:\Documents and Settings\John Muir\My
Documents\LETTER-TEMPLATE ALL PARTIES TO LOSS.doc)
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String
DocPath = "Path and name of the document"
Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)
objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display
End Function
Thanks,
John
Ofer - 31 Oct 2005 16:52 GMT
Have you created a reference to Microsoft word?
Open code (any where) select Tools > reference > add from the list Microsoft
word
About the code, try this
Private Sub Command77_Click()
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String
DocPath = "C:\Documents and Settings\John Muir\My Documents\LETTER-TEMPLATE
ALL PARTIES TO LOSS.doc"
Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)
objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display
End Sub

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> I got several messages - I probably pasted in the wrong spot - here's the code:
>
[quoted text clipped - 38 lines]
>
> John