|
-
September 28th, 2001, 05:39 AM
#1
Mail Merge Data Source
Does anyone have some code for setting the OpenDataSource on a Word Automation Mail Merge to use SQL Server via OLE DB, looked everywhere but no joy...
Thanks
Only found Access see below:
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Automation\Northwind.MDB", ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="QUERY qryEmployeeLetters", SQLStatement:= _
"SELECT * FROM [qryEmployeeLetters]", SQLStatement1:=""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|