PC Review


Reply
Thread Tools Rate Thread

Automating mail merge from excel

 
 
Cheese_whiz
Guest
Posts: n/a
 
      13th Nov 2008
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 With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      14th Nov 2008
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" <(E-Mail Removed)> wrote in message
news:00D4BFA5-7150-4658-BB4F-(E-Mail Removed)...
> 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 With Quote
 
Cheese_whiz
Guest
Posts: n/a
 
      14th Nov 2008
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" <(E-Mail Removed)> wrote in message
> news:00D4BFA5-7150-4658-BB4F-(E-Mail Removed)...
> > 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 With Quote
 
Peter T
Guest
Posts: n/a
 
      14th Nov 2008
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" <(E-Mail Removed)> wrote in message
news:F85D7307-8FAD-4E3D-858B-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:00D4BFA5-7150-4658-BB4F-(E-Mail Removed)...
>> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Automating mail merge? Ken Slovak - [MVP - Outlook] Microsoft Outlook VBA Programming 0 6th Sep 2005 03:19 PM
Automating Mail Merge query =?Utf-8?B?U3RlcGhhbmll?= Microsoft Access Queries 1 18th Jul 2005 07:17 PM
Automating Mail Merge =?Utf-8?B?RWQgU2hhbmxleQ==?= Microsoft Access VBA Modules 2 1st Mar 2005 03:29 PM
Real problems automating a mail merge nath Microsoft Excel Programming 0 10th Jun 2004 11:32 AM
Automating mail merge =?Utf-8?B?TUg=?= Microsoft Access Macros 1 6th May 2004 09:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:38 PM.