Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
VB6 and mailmerge
Old
  (#1)
Geoff
Guest
 
Posts: n/a
Default VB6 and mailmerge - 06-04-2007, 10:35 AM

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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: VB6 and mailmerge
Old
  (#2)
Ralph
Guest
 
Posts: n/a
Default Re: VB6 and mailmerge - 06-04-2007, 10:35 AM


"Geoff" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED 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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Contact Us - Forum Care Forums - Archive - Top