By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,632 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,632 IT Pros & Developers. It's quick & easy.

VB6 and mailmerge

P: n/a
Really not too sure what I am doing. I would like to launch MS Word from
VB6 so that it will mail- merge with a comma delimited text file called
Data.txt. The code below launches MS Word but how to invoke the merge from
VB .. don't know

Many thanks Geoff

Private Sub Command1_Click()

On Error GoTo Err_merge_Click


'Load the mail merge document as an object

Dim objWord As Object

Set objWord = GetObject("E:\Word\VB\Merge.doc")
'Make Word visible

objWord.Application.Visible = True

Exit Sub

Err_merge_Click:

MsgBox Err.Description

End Sub
Mar 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Geoff" <gf****@freenetname.co.ukwrote in message
news:lo******************************@brightview.c om...
Really not too sure what I am doing. I would like to launch MS Word from
VB6 so that it will mail- merge with a comma delimited text file called
Data.txt. The code below launches MS Word but how to invoke the merge
from
VB .. don't know

Many thanks Geoff

Private Sub Command1_Click()

On Error GoTo Err_merge_Click


'Load the mail merge document as an object

Dim objWord As Object

Set objWord = GetObject("E:\Word\VB\Merge.doc")
'Make Word visible

objWord.Application.Visible = True

Exit Sub

Err_merge_Click:

MsgBox Err.Description

End Sub

"How to automate Word with Visual Basic to create a Mail Merge"
http://support.microsoft.com/kb/285332

You might find these articles useful...
http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx
http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx

-ralph
Mar 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.