Home All Groups Group Topic Archive Search About

Incorporating Word letter merge into VB6 app

Author
2 Mar 2007 2:45 PM
Sandy
Hello -

I need to create letter merges in a VB6 application by using MS Word and
supplying the name and address from a Sql Server 2005 database.

Can anyone point me in the direction of how to do this?  Any help will be
greatly appreciated!

--
Sandy

Author
2 Mar 2007 3:38 PM
Ralph
"Sandy" <Sa***@discussions.microsoft.com> wrote in message
news:906E9CC3-F1E5-470A-AB8A-6C02A5060DB2@microsoft.com...
> Hello -
>
> I need to create letter merges in a VB6 application by using MS Word and
> supplying the name and address from a Sql Server 2005 database.
>
> Can anyone point me in the direction of how to do this?  Any help will be
> greatly appreciated!
>
> --
> Sandy

http://support.microsoft.com/kb/285176
http://support.microsoft.com/kb/258512/

With the latter, note than you can easily replace the text file with any
datasource - an ADO Recordset from a store procedure, for example. There are
lots of ways to skin this cat.

Also you didn't mention what version of Word you are using. There are subtle
differences in mail merge between them. So be on the lookout.

One of the easiest ways to figure out how to 'automate' any Office product
is to create a keystroke Macro (VBA) in the product and then examine the
generated code. (The code is often ugly and inefficient - but always
informative. <g>)

hth
-ralph