Hi everybody... I've been working on moving access data to a word document for the last 10 days but keep getting stuck. The latest problem is that i'm getting the error "Object Variable Or With Block Variable Not Set". The code is as follows.
Dim objWord As New Word.Document
Set objWord=GetObje ct("C:\Abc.doc" )
objWord.Applica tion.Visible=Tr ue
objWord.MailMer ge.OpenDataSour ce _
Name:=CurrentDb .Name, _
LinkToSource:=T rue, _
Connection:="TA BLE BasicDetails", _
SQLStatement:=" Select * FROM BasicDetails"
objWord.MailMer ge.Execute
Also, is there any other way to send data from a form to a Word Document (where the form is displaying certain rows from a table)?
Dim objWord As New Word.Document
Set objWord=GetObje ct("C:\Abc.doc" )
objWord.Applica tion.Visible=Tr ue
objWord.MailMer ge.OpenDataSour ce _
Name:=CurrentDb .Name, _
LinkToSource:=T rue, _
Connection:="TA BLE BasicDetails", _
SQLStatement:=" Select * FROM BasicDetails"
objWord.MailMer ge.Execute
Also, is there any other way to send data from a form to a Word Document (where the form is displaying certain rows from a table)?
Comment