Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Automating mail merge from excel

Hi all,

I'm mostly an access guy, so I'm not unfamiliar with vba (access vba,
anyway)...

I think I need to automate a word mail merge from Excel. What I need to do
is check (or filter) a list in version 2003 for no entries in a date column.
For those records that have no entries in the date column, I need to merge
those into a word document and then add today's date (Date()) as the column
value to those records. I want to print the word document, but most likely
I'd be just as happy if not more happy to do that manually once the merge has
been completed.

Does that sound like working from excel is the way to go, maybe utilizing an
already setup mail merge file in word? Could I (in vba) filter the records,
run the merge, and then append the date values from within excel? Can anyone
point me to some code to start me out?

Any direction would be greatly appreciated. I've automated exel and word
from access, but never word from excel, and I'm not even sure what I'm asking
is feasible.

Thanks,
CW
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Automating mail merge from excel

I don't quite follow why you need to automate Word's mail merge from Excel,
or rather which aspect(s) of the entire process need(s) to be automated.

I can see perhaps you might want to automate the creation of your Mail Merge
data in Excel. Filter your data as required, copy it to a dedicated sheet
(in same or another file). Alternatively to a Named range. Ensure the top
row is headers and there are no entirely blank rows. All this process might
be pretty straightforward, manually or programmatically. Don't forget Word
also has the ability to filter data, in a similar way to Excels Data/filter,
depends on what you need.

In Word, Tools / Letters & mailings / Mail merge, follow the wizard. In step
3 browse to your Excel file, and again follow the Wizard. When almost done
don't preview but save the doc as a Template.

Of course there's a bit more to it, no doubt the entire process can be
automated from either Excel or Word but would need to know more details (I'm
not a mail merge expert!).

Regards,
Peter T



"Cheese_whiz" wrote in message
...
Hi all,

I'm mostly an access guy, so I'm not unfamiliar with vba (access vba,
anyway)...

I think I need to automate a word mail merge from Excel. What I need to
do
is check (or filter) a list in version 2003 for no entries in a date
column.
For those records that have no entries in the date column, I need to merge
those into a word document and then add today's date (Date()) as the
column
value to those records. I want to print the word document, but most
likely
I'd be just as happy if not more happy to do that manually once the merge
has
been completed.

Does that sound like working from excel is the way to go, maybe utilizing
an
already setup mail merge file in word? Could I (in vba) filter the
records,
run the merge, and then append the date values from within excel? Can
anyone
point me to some code to start me out?

Any direction would be greatly appreciated. I've automated exel and word
from access, but never word from excel, and I'm not even sure what I'm
asking
is feasible.

Thanks,
CW



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Automating mail merge from excel

Thanks for the reply, Peter.

The reason I wanted to do it from excel was so I could execute some
functions IN excel after the automation code ran. While I could probably do
that from word as well, it just seemed easier to start in excel, and a more
logical approach for my users, too, who may want to see the merge data
directly in excel.

I think I've found a suitable solution to this issue. Automation doesn't
seem to work with mail merge anyway. I'm guessing like in other situations,
things can be a little different if you open a program and then open a file
in that program than if you just open the file directly. Hopefully, I can
get this shell command working....not sure what the issue is....used shell in
any number of other situations.

Anyway, thanks for the response.

CW

"Peter T" wrote:

I don't quite follow why you need to automate Word's mail merge from Excel,
or rather which aspect(s) of the entire process need(s) to be automated.

I can see perhaps you might want to automate the creation of your Mail Merge
data in Excel. Filter your data as required, copy it to a dedicated sheet
(in same or another file). Alternatively to a Named range. Ensure the top
row is headers and there are no entirely blank rows. All this process might
be pretty straightforward, manually or programmatically. Don't forget Word
also has the ability to filter data, in a similar way to Excels Data/filter,
depends on what you need.

In Word, Tools / Letters & mailings / Mail merge, follow the wizard. In step
3 browse to your Excel file, and again follow the Wizard. When almost done
don't preview but save the doc as a Template.

Of course there's a bit more to it, no doubt the entire process can be
automated from either Excel or Word but would need to know more details (I'm
not a mail merge expert!).

Regards,
Peter T



"Cheese_whiz" wrote in message
...
Hi all,

I'm mostly an access guy, so I'm not unfamiliar with vba (access vba,
anyway)...

I think I need to automate a word mail merge from Excel. What I need to
do
is check (or filter) a list in version 2003 for no entries in a date
column.
For those records that have no entries in the date column, I need to merge
those into a word document and then add today's date (Date()) as the
column
value to those records. I want to print the word document, but most
likely
I'd be just as happy if not more happy to do that manually once the merge
has
been completed.

Does that sound like working from excel is the way to go, maybe utilizing
an
already setup mail merge file in word? Could I (in vba) filter the
records,
run the merge, and then append the date values from within excel? Can
anyone
point me to some code to start me out?

Any direction would be greatly appreciated. I've automated exel and word
from access, but never word from excel, and I'm not even sure what I'm
asking
is feasible.

Thanks,
CW




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Automating mail merge from excel

I don't see why you can't automate the entire mail merge process either from
Excel or Word or from some other appropriate app.

Indeed there are several differences between Shell and normal automation,
though I can't think how you'd do this particular task with Shell.

Regards,
Peter T

"Cheese_whiz" wrote in message
...
Thanks for the reply, Peter.

The reason I wanted to do it from excel was so I could execute some
functions IN excel after the automation code ran. While I could probably
do
that from word as well, it just seemed easier to start in excel, and a
more
logical approach for my users, too, who may want to see the merge data
directly in excel.

I think I've found a suitable solution to this issue. Automation doesn't
seem to work with mail merge anyway. I'm guessing like in other
situations,
things can be a little different if you open a program and then open a
file
in that program than if you just open the file directly. Hopefully, I can
get this shell command working....not sure what the issue is....used shell
in
any number of other situations.

Anyway, thanks for the response.

CW

"Peter T" wrote:

I don't quite follow why you need to automate Word's mail merge from
Excel,
or rather which aspect(s) of the entire process need(s) to be automated.

I can see perhaps you might want to automate the creation of your Mail
Merge
data in Excel. Filter your data as required, copy it to a dedicated sheet
(in same or another file). Alternatively to a Named range. Ensure the top
row is headers and there are no entirely blank rows. All this process
might
be pretty straightforward, manually or programmatically. Don't forget
Word
also has the ability to filter data, in a similar way to Excels
Data/filter,
depends on what you need.

In Word, Tools / Letters & mailings / Mail merge, follow the wizard. In
step
3 browse to your Excel file, and again follow the Wizard. When almost
done
don't preview but save the doc as a Template.

Of course there's a bit more to it, no doubt the entire process can be
automated from either Excel or Word but would need to know more details
(I'm
not a mail merge expert!).

Regards,
Peter T



"Cheese_whiz" wrote in message
...
Hi all,

I'm mostly an access guy, so I'm not unfamiliar with vba (access vba,
anyway)...

I think I need to automate a word mail merge from Excel. What I need
to
do
is check (or filter) a list in version 2003 for no entries in a date
column.
For those records that have no entries in the date column, I need to
merge
those into a word document and then add today's date (Date()) as the
column
value to those records. I want to print the word document, but most
likely
I'd be just as happy if not more happy to do that manually once the
merge
has
been completed.

Does that sound like working from excel is the way to go, maybe
utilizing
an
already setup mail merge file in word? Could I (in vba) filter the
records,
run the merge, and then append the date values from within excel? Can
anyone
point me to some code to start me out?

Any direction would be greatly appreciated. I've automated exel and
word
from access, but never word from excel, and I'm not even sure what I'm
asking
is feasible.

Thanks,
CW






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
How do I do an e-mail mail merge using an Excel spreadsheet? Gretchen Excel Worksheet Functions 0 July 19th 09 05:18 PM
Mail merge macro: select recipients from Excel during merge Worksmart Excel Programming 0 May 18th 08 06:37 PM
Code launches Mail Merge but disables the Mail Merge austris Excel Discussion (Misc queries) 0 October 14th 06 01:11 AM
Real problems automating a mail merge nath Excel Programming 0 June 10th 04 11:32 AM


All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"