Merge Word

S

SHIPP

I just converted a database from 97 to 2003. In 97 the following code worked
fine.

On Error GoTo HandleErr
Const cstrProcName As String = "basMerge - mrgWord"

Dim objWord As Word.Document

Set objWord = GetObject(GetStrDocPath() & "\" & GetStrDocName(),
"Word.Document")
objWord.Application.Visible = True ' delete afterwards
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
objWord.Application.ActiveDocument.Close wdDoNotSaveChanges
objWord.Application.Quit wdDoNotSaveChanges


However in Office 2003 the code stops dead with an error message at the
line...

objWord.MailMerge.Execute

The error received is "Data source name not found and no driver specified."

Any help you could offer would be greatly appreciated.
 
S

SHIPP

Answered it myself. I had to go into Word, reset up the data source and save
it. Worked fine after that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top