S
Sarah
Hi folks. I am using this code to open a mail merge
Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("Shared\Russ Reid1\TYLetters\2009 Form
Letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="\\Firebox\shared\Development\Data\Contact Database\NAME.mdb", _
LinkToSource:=True, _
Connection:="Query qrymailmergefinal", _
SQLStatement:="SELECT * FROM [qrymailmergefinal]"
' Execute the mail merge.
DoCmd.CloseDatabase
objWord.MailMerge.Execute
End Function
and it appears to work fine except I get a db locked error. Any thoughts?
Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("Shared\Russ Reid1\TYLetters\2009 Form
Letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="\\Firebox\shared\Development\Data\Contact Database\NAME.mdb", _
LinkToSource:=True, _
Connection:="Query qrymailmergefinal", _
SQLStatement:="SELECT * FROM [qrymailmergefinal]"
' Execute the mail merge.
DoCmd.CloseDatabase
objWord.MailMerge.Execute
End Function
and it appears to work fine except I get a db locked error. Any thoughts?