VB to MS Word Mergefield 
Author Message
 VB to MS Word Mergefield


>I have a record from a SQL database and want to populate the mergefields in
>a Word document.  How do you accomplish the merge?  I know how to do the
>process by using bookmarks, but I am required to use mergefields with MS
>Word 7.0.  HELP!!!

I was faced with the same task.  The approach I took was to have VB4 read get
the data form SQL Server, then write out a text file in the format that Word
can read.  The first line of the text file contains field names, the subsequent
lines contain date -- all separated by tabs.

We have one text file format with all possible fields that any letter may
require, then we have dozens of letters that use this text file in a mail

We have VB instruct Word via OLE to open up a letter document, use the mail
merge file, do the mail merge, and print.  We even give the user the choice to
fax it via WinFax.

Out of laziness we have VB create a file called C:\MAILMERG.TXT.

This nice thing about this approach is that once you create the MAILMERG.TXT
file once, you can then use it in Word when you are preparing your letters.  
And it works to print one letter or hundreds of them.  And the creation of the
text file is amazingly fast.

Good luck!

Hank Luhring


Sun, 07 Nov 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. VB to MS Word Mergefield

2. VB to MS Word Mergefield

3. VB to MS Word Mergefield

4. WORD 2000 mergefield

5. Call vba function from word mergefield

6. Word VBA to Save File Name from MergeField

7. Q:Envoking MS-Word from VB4 when Exchange is using MS-Word

8. MergeField manipulation by VB Code

9. How does one look at data in an open MS access aplication from MS Word

10. Working with MS Word and MS Access

11. MS Access & MS Word Automation/Security Issue

12. MS PJ 2000 and MS Word via VBA


Powered by phpBB® Forum Software