Open Word template

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I want to create a new Word document base on my template from within Access
form. Any ideas will be appreciated.
 
Thanks. I've tried to copy code from the link, create a Merge.dot in default
template folder, etc ... But when I click the Command1 button, I get the
Msgbox: "Compile error ; User-defined type not defined". I tried both Access
2000 and Access 2002. For more info, when I use the Command Button Wizard to
open MS Word, this is the sample code:
'---------------------------------------
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
'-----------------------------------------
Thanks for your concern
 
Back
Top