Merging : how to write criteria with VBA?

S

Souriane

Hi!

I would like to do a merge in Word with an Excel document.

I do this same merging very often but the source document changes name
every day. and must keep its new name. So, each time I open my main
document, I must always reselect the source document and of course,
rewrite the criteria to do the merging (ex.: field "Sum" is higher
than 100, etc.)

When I record the macro and change the criteria, nothing shows up in
the macro code.

Can you help me?

Thank you!

Souriane
 
M

macropod

Hi Souriane,

It would be simpler to:
1. point your mailmerge main document to a generically-named data source
2. make a copy of the daily data source file and save it with the generic name
3. run the mailmerge?
That way, there's no need to reconstruct the query every time.
 
C

Cindy M.

Hi Souriane,
I would like to do a merge in Word with an Excel document.

I do this same merging very often but the source document changes name
every day. and must keep its new name. So, each time I open my main
document, I must always reselect the source document and of course,
rewrite the criteria to do the merging (ex.: field "Sum" is higher
than 100, etc.)

When I record the macro and change the criteria, nothing shows up in
the macro code.

Which version of Word is involved?

Do you select any specific type of data connection, or are you working
with the default?

How do you want to tell Word what the new data source file name (just
name, or also path) is?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
S

Souriane

Thank you Cindy for your answer!. I was on vacation, couldn't answer
before.
Which version of Word is involved?
Word 2003
Do you select any specific type of data connection, or are you working
with the default?
With the default
How do you want to tell Word what the new data source file name (just
name, or also path) is?

The full path.

Thank you!
Souriane
 

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