Merge with Word 2003!

D

Damon

Hi,

I have created a class merge in my VB6 app which does a nice mail merge with
word 2000, I have been using this for the last three years. However I have
recently gone over to Word 2003 and when I try to use use my mail merge it
comes up with Run-time error '5631' Word could not merge the main document
with the data source because the data records were empty or no data records
matched your query options. I have had a look on the Microsoft website and
it suggests to Save the Data document before attempting the Merge, which I
have done and it works fine, however this isn;t really the work around I was
after as I do not want to save the data document as it will be used over and
over for different reports. Was wondering if anyone out there had a
workaround in which I didn;t have to save the data document - would
appreciate the help on this.

Thanks

Damon
 
P

Peter Jamieson

as I do not want to save the data document as it will be used over and
over for different reports

There's nothing I can do about this change in behaviour in Word 2003, but in
what way does saving the data document affect your ability to re-use it?
 
D

Damon

When you save the data document it obviously saves the data which has been
loaded into it, when it gets used again it will be loaded with a different
set of data, how would I be able to tell it to load the most current data.
Plus if this is getting used a lot then the document is going to become very
big very soon.

Damon
 
D

Damon

Have just tried it with another report and it loads the first reports data
and the second report data into the same document, I need it to be a fresh
data document every time but because it has to be saved I cannot do this.
Any ideas? Appreciate the help as would like to move to Word 2003 but if I
cannot resolve this will have to stick with Word 2000 or XP.

Thanks

Damon
 
P

Peter Jamieson

As far as I can see you need to change the way you maintain your data
document.

So far I've been assuming that it is in fact a Word document, but maybe that
is not the case.

If you save the data document, your code could for example
a. re-open it if it exists, or create it if it does not
b. delete all the contents if you are rep-opening
c. populate the document
d. save it
e. merge

Or you might be able to do the following:
a. delete it if it exists
b. creat and populate a new document
c. save it
d. merge

I think you would only run into problems if the user was able to keep a mail
merge main document open that referenced a saved document. Then, you might
have problems opening it/deleting it/updating it. But as long as an error is
returned in those situations you could create a new document and leave the
existing one alone.
 
D

Damon

Thanks for your reply.

So basically if I want to use Word 2003, I am going to have to completely
change my mail merge process. This would be far to time consuming as I have
18 data documents and over 100 reports that reference them. Will have to
stick with Word XP as this works without any problems.

Thanks again for your time & help.

Damon
 

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