[AccessD] Mailmerge Using Word & SQL Server (VB6)

paul.hartland at fsmail.net paul.hartland at fsmail.net
Wed Dec 17 03:24:55 CST 2003


Thanks, that should get me started......

Paul Hartland





Message date : Dec 17 2003, 09:19 AM
>From : William Hindman 
To : Access Developers discussion and problem solving 
Copy to : 
Subject : Re: [AccessD] Mailmerge Using Word & SQL Server (VB6)
...don't have any merge code to SS7 Paul but the data connection syntax
should be the same ...here's how I do it from an Access FE local table
...HTH :)

Function ShowDirectory()
Dim objWord As Word.Document
Set objWord = GetObject("C:\Program
Files\EMSReports\Documents\ShowDirectory.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the EMSReports database.
objWord.MailMerge.OpenDataSource _
Name:="C:\Program Files\EMSReports\emsreports.mdb", _
LinkToSource:=True, _
Connection:="TABLE tblShowDir", _
SQLStatement:="Select * from [tblShowDir]"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function

William Hindman
There are no easy answers, but there are simple answers. We must have
the courage to do what we know is morally right." --Ronald Reagan


----- Original Message ----- 
From: 
To: "accessd" 
Cc: "dba-vb" 
Sent: Wednesday, December 17, 2003 4:01 AM
Subject: [AccessD] Mailmerge Using Word & SQL Server (VB6)


To all,

I am starting to write a mailmerge application for our own internal use, I
want the user to be able to select the people they want to mail to and store
these in a temporary merge table on SQL Server 7.0 (this I have already
done). I also give them the option to select an exisiting Word document or
create a new one (also done)..

I need to know how (when the user opens the Word document), I can tell the
document to look at my temporary merge table on SQL Server 7.0.

Anyone know how I can do this as I have never tried to connect a Word
document to a datasource via code before.

Thanks in advance for any help.

Paul Hartland
Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month
www.freeserve.com/anytime
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month 
www.freeserve.com/anytime


More information about the AccessD mailing list