VB6 and Mailmerge with MS Word 2010

DrSnuggles

Well the hell is Hudson??
Local time
Today, 11:03
Joined
Sep 14, 2004
Messages
117
Hi guys,

I'm sounding like a right newbie when asking this...

I have a VB6 project that mail merges with MS Word 97-2003.

Now we have office 2010 and the code doesn't work.

I've tried googling all afternoon with no avail.

The data source is a txt file with delimited data generated from the DB and some code before.

I've just been hitting my head against the wall all afternoon!
I'm suspecting there are different hierarchical trees with Word 2010??
My code below, get an error object not set.

Dim objWord As Word.Document
Set objWord.Documents.Open = GetObject(gstrMailMergePath & gstrMailMergeTemplateAcceptanceLetterFilePath, "Word.Document")

' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source.
With objWord.MailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=gstrMailMergePath & gstrMailMergeDataSourceForLettersFilePath
End With
' Execute the mail merge.
objWord.MailMerge.Execute
objWord.MailMerge.Destination = wdSendToNewDocument
 

Users who are viewing this thread

Back
Top Bottom