Hi guys
im trying to change the MS Workd mailmerge document type in VBA from Access any ideas??
Thanks
current code:
'make sure there is data to merge
If (tbl.RecordCount > 0) Then
strDocName = "Additional_Forms.doc"
strNewName = "Last_Additional_Forms"
objWord.Application.Visible = True
Set objDoc = objWord.Documents.Open(strDir & strDocName)
'Make Word visible so that if any errors occur, you can close the instance of Word manually
objWord.Application.Visible = True
Call objDoc.MailMerge.OpenDataSource(Name:=strDir & strDB, LinkToSource:=True, Connection:="TABLE ECB_Additional_Forms_toSend", SQLstatement:="SELECT * FROM ECB_Additional_Forms_toSend", SubType:=wdMergeSubTypeWord2000)
'objDoc.MailMerge.Destination = wdSendToNewDocument
'objDoc.MailMerge.Execute
letters = True
End If
im trying to change the MS Workd mailmerge document type in VBA from Access any ideas??
Thanks
current code:
'make sure there is data to merge
If (tbl.RecordCount > 0) Then
strDocName = "Additional_Forms.doc"
strNewName = "Last_Additional_Forms"
objWord.Application.Visible = True
Set objDoc = objWord.Documents.Open(strDir & strDocName)
'Make Word visible so that if any errors occur, you can close the instance of Word manually
objWord.Application.Visible = True
Call objDoc.MailMerge.OpenDataSource(Name:=strDir & strDB, LinkToSource:=True, Connection:="TABLE ECB_Additional_Forms_toSend", SQLstatement:="SELECT * FROM ECB_Additional_Forms_toSend", SubType:=wdMergeSubTypeWord2000)
'objDoc.MailMerge.Destination = wdSendToNewDocument
'objDoc.MailMerge.Execute
letters = True
End If