MailMerge DataSource problem

M

Marty

Hi-

I'm running Word97. I have a DOT template which runs a
macro. In the macro, I have an ADO connection to get my
data. I also have WordBasic.MailMergeOpenDataSource
statement which keeps bombing out with error 1535, saying
that there were no records to be returned. This is
because the stored procedure is probably not returning
anything. (I want to eliminate the stored procedure, not
fix it.)

But I already have all the info that I need from the ADO
connection. And, I get this into the document using
ActiveDocument.Variables.Add commands.

How do I execute the Mail Merge without the stored
procedure?

Thanks for all the help.
 
C

Cindy M -WordMVP-

Hi Marty,

I think you're a bit mixed up on what mail merge is, and
what it can, or cannot, do.

Mail merge only works with a data source stored as a file.
Mail merge puts data from this file into the merge fields.

It cannot pick up data from an ADO source in memory, nor
from Doc Variables in the document.

Which brings up the question in my mind, if you want to
detach the data source, why do you still want to execute the
mail merge? Are you wanting to get a new document to save?
Then use the SaveAs method on the document. Are you wanting
to print? Then use the PrintOut method.
I'm running Word97. I have a DOT template which runs a
macro. In the macro, I have an ADO connection to get my
data. I also have WordBasic.MailMergeOpenDataSource
statement which keeps bombing out with error 1535, saying
that there were no records to be returned. This is
because the stored procedure is probably not returning
anything. (I want to eliminate the stored procedure, not
fix it.)

But I already have all the info that I need from the ADO
connection. And, I get this into the document using
ActiveDocument.Variables.Add commands.

How do I execute the Mail Merge without the stored
procedure?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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