Reply
 
Thread Tools Display Modes
  #1   Report Post  
AS
 
Posts: n/a
Default mail merge with attachments

Hello,

I found this article with details on a macro to have an attachment with a ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge fields in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail merge and
have the macro run after the fields are populated in the word document. Th
is would fill the fields required with the pertinent information then attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the document but
the fields in the word document only show the merge fields (not actual valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with the att
achments and with the result of execution of that mail merge on the screen,
run a macro containing the following code. When the File open dialog appear
s, select the file containing the table created by the catalogue type mail m
erge.'

From the sounds of this, the mail merge should run as normal then call up th
e macro to add the attachment. But, in my case, the mail merge runs without
calling up this macro - any ideas?


  #2   Report Post  
Doug Robbins - Word MVP
 
Posts: n/a
Default

YOU have to run the macro which is what " and with the result of execution
of that mail merge on the screen,
run a macro containing the following code. " says. You must also follow
exactly all of the steps in the process if you want it to work.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Hello,

I found this article with details on a macro to have an attachment with a

ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge fields

in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail merge

and
have the macro run after the fields are populated in the word document.

Th
is would fill the fields required with the pertinent information then

attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the document

but
the fields in the word document only show the merge fields (not actual

valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with the

att
achments and with the result of execution of that mail merge on the

screen,
run a macro containing the following code. When the File open dialog

appear
s, select the file containing the table created by the catalogue type mail

m
erge.'

From the sounds of this, the mail merge should run as normal then call up

th
e macro to add the attachment. But, in my case, the mail merge runs

without
calling up this macro - any ideas?



  #3   Report Post  
AS
 
Posts: n/a
Default

Thanks for the reply Doug,

I think I am missing something on this though. I followed the document to a
T but when I run the macro, the first merge works fine. The fields in the
first email message are filled in according to the data source and the
appropriate attachment is in the message.
All subsequent messages are sent with the proper attachments but the email
messages are blank. No text, no merged fields, just blank.
I am using Word 2003 as the directory / catalog and actual document to
merge. I am using excel 2003 as the data source. I am using Outlook 2003
setup to an exchange server for the mail application.

I think I may be missing something here in your instructions:

'Then execute the mail merge that you want to send out by email with the
attachments and with the result of execution of that mail merge on the
screen,'

I have the mail merge document on the screen and have the first record
fields showing (I tried running this showing different record sets as well
with the same result) - I go to run the macro and select the directory merge
I created as stated earlier in the instructions. The email merge runs fine.
But I check the resultant emails sent / received and only the first email in
the list has the correct fields merged - all others are blank.

Any suggestions? Is there something different with Word 2003 to cause this?

AS




"Doug Robbins - Word MVP" wrote in message
...
YOU have to run the macro which is what " and with the result of execution
of that mail merge on the screen,
run a macro containing the following code. " says. You must also follow
exactly all of the steps in the process if you want it to work.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Hello,

I found this article with details on a macro to have an attachment with a

ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge fields

in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail merge

and
have the macro run after the fields are populated in the word document.

Th
is would fill the fields required with the pertinent information then

attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the document

but
the fields in the word document only show the merge fields (not actual

valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with the

att
achments and with the result of execution of that mail merge on the

screen,
run a macro containing the following code. When the File open dialog

appear
s, select the file containing the table created by the catalogue type
mail

m
erge.'

From the sounds of this, the mail merge should run as normal then call up

th
e macro to add the attachment. But, in my case, the mail merge runs

without
calling up this macro - any ideas?





  #4   Report Post  
Doug Robbins - Word MVP
 
Posts: n/a
Default

Is it the mailmerge main document that you have on the screen when you run
the macro or have you executed the mailmerge to a new document and then it
is with that document on the screen that you should run the macro.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Thanks for the reply Doug,

I think I am missing something on this though. I followed the document to

a
T but when I run the macro, the first merge works fine. The fields in the
first email message are filled in according to the data source and the
appropriate attachment is in the message.
All subsequent messages are sent with the proper attachments but the email
messages are blank. No text, no merged fields, just blank.
I am using Word 2003 as the directory / catalog and actual document to
merge. I am using excel 2003 as the data source. I am using Outlook 2003
setup to an exchange server for the mail application.

I think I may be missing something here in your instructions:

'Then execute the mail merge that you want to send out by email with the
attachments and with the result of execution of that mail merge on the
screen,'

I have the mail merge document on the screen and have the first record
fields showing (I tried running this showing different record sets as well
with the same result) - I go to run the macro and select the directory

merge
I created as stated earlier in the instructions. The email merge runs

fine.
But I check the resultant emails sent / received and only the first email

in
the list has the correct fields merged - all others are blank.

Any suggestions? Is there something different with Word 2003 to cause

this?

AS




"Doug Robbins - Word MVP" wrote in message
...
YOU have to run the macro which is what " and with the result of

execution
of that mail merge on the screen,
run a macro containing the following code. " says. You must also follow
exactly all of the steps in the process if you want it to work.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions

forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Hello,

I found this article with details on a macro to have an attachment with

a
ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge

fields
in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail

merge
and
have the macro run after the fields are populated in the word

document.
Th
is would fill the fields required with the pertinent information then

attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the

document
but
the fields in the word document only show the merge fields (not actual

valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with

the
att
achments and with the result of execution of that mail merge on the

screen,
run a macro containing the following code. When the File open dialog

appear
s, select the file containing the table created by the catalogue type
mail

m
erge.'

From the sounds of this, the mail merge should run as normal then call

up
th
e macro to add the attachment. But, in my case, the mail merge runs

without
calling up this macro - any ideas?






  #5   Report Post  
Matt B
 
Posts: n/a
Default

AS,

I really appriciate the work Doug put into this macro and finally finding
this post in this community. I did however encounter the same problems as
you. I'm using Word 2003 and Outlook 2003. I'm not sure if the solution I
used will work for you (maybe Doug can comment on it) but it worked for me.
I modified the code a little. I think the problem is that the code calls for
the macro to "Cut" the email in order to paste it to the new doc. In the
code after the line:

While Counter = Maillist.Tables(1).Rows.count

if you change the line that reads:

Source.Sections.First.Range.Cut

to

Source.Sections.First.Range.Copy

the macro will stop pasting blank pages after the first. In addition I had
to add another line to force the Sorce file to go to the next record. I
added the line:

Source.MailMerge.DataSource.ActiveRecord = wdNextRecord

to the macro just after the statement:

Counter = counter + 1.

I executed the mail merge of the form letter so that it was positioned on
the first record then I executed the macro.

Hope this helps.

"AS" wrote:

Thanks for the reply Doug,

I think I am missing something on this though. I followed the document to a
T but when I run the macro, the first merge works fine. The fields in the
first email message are filled in according to the data source and the
appropriate attachment is in the message.
All subsequent messages are sent with the proper attachments but the email
messages are blank. No text, no merged fields, just blank.
I am using Word 2003 as the directory / catalog and actual document to
merge. I am using excel 2003 as the data source. I am using Outlook 2003
setup to an exchange server for the mail application.

I think I may be missing something here in your instructions:

'Then execute the mail merge that you want to send out by email with the
attachments and with the result of execution of that mail merge on the
screen,'

I have the mail merge document on the screen and have the first record
fields showing (I tried running this showing different record sets as well
with the same result) - I go to run the macro and select the directory merge
I created as stated earlier in the instructions. The email merge runs fine.
But I check the resultant emails sent / received and only the first email in
the list has the correct fields merged - all others are blank.

Any suggestions? Is there something different with Word 2003 to cause this?

AS




"Doug Robbins - Word MVP" wrote in message
...
YOU have to run the macro which is what " and with the result of execution
of that mail merge on the screen,
run a macro containing the following code. " says. You must also follow
exactly all of the steps in the process if you want it to work.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Hello,

I found this article with details on a macro to have an attachment with a

ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge fields

in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail merge

and
have the macro run after the fields are populated in the word document.

Th
is would fill the fields required with the pertinent information then

attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the document

but
the fields in the word document only show the merge fields (not actual

valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with the

att
achments and with the result of execution of that mail merge on the

screen,
run a macro containing the following code. When the File open dialog

appear
s, select the file containing the table created by the catalogue type
mail

m
erge.'

From the sounds of this, the mail merge should run as normal then call up

th
e macro to add the attachment. But, in my case, the mail merge runs

without
calling up this macro - any ideas?








  #6   Report Post  
Doug Robbins
 
Posts: n/a
Default

The reason that you had to make these changes is because you did NOT execute
the mailmerge that creates the text for the body of the email messages to a
new document and then run the macro with that document as the active
document.

What you have done is execute the macro with the mailmerge results being
previewed in the mailmerge main document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Matt B" Matt wrote in message
...
AS,

I really appriciate the work Doug put into this macro and finally finding
this post in this community. I did however encounter the same problems as
you. I'm using Word 2003 and Outlook 2003. I'm not sure if the solution
I
used will work for you (maybe Doug can comment on it) but it worked for
me.
I modified the code a little. I think the problem is that the code calls
for
the macro to "Cut" the email in order to paste it to the new doc. In the
code after the line:

While Counter = Maillist.Tables(1).Rows.count

if you change the line that reads:

Source.Sections.First.Range.Cut

to

Source.Sections.First.Range.Copy

the macro will stop pasting blank pages after the first. In addition I
had
to add another line to force the Sorce file to go to the next record. I
added the line:

Source.MailMerge.DataSource.ActiveRecord = wdNextRecord

to the macro just after the statement:

Counter = counter + 1.

I executed the mail merge of the form letter so that it was positioned on
the first record then I executed the macro.

Hope this helps.

"AS" wrote:

Thanks for the reply Doug,

I think I am missing something on this though. I followed the document
to a
T but when I run the macro, the first merge works fine. The fields in
the
first email message are filled in according to the data source and the
appropriate attachment is in the message.
All subsequent messages are sent with the proper attachments but the
email
messages are blank. No text, no merged fields, just blank.
I am using Word 2003 as the directory / catalog and actual document to
merge. I am using excel 2003 as the data source. I am using Outlook
2003
setup to an exchange server for the mail application.

I think I may be missing something here in your instructions:

'Then execute the mail merge that you want to send out by email with the
attachments and with the result of execution of that mail merge on the
screen,'

I have the mail merge document on the screen and have the first record
fields showing (I tried running this showing different record sets as
well
with the same result) - I go to run the macro and select the directory
merge
I created as stated earlier in the instructions. The email merge runs
fine.
But I check the resultant emails sent / received and only the first email
in
the list has the correct fields merged - all others are blank.

Any suggestions? Is there something different with Word 2003 to cause
this?

AS




"Doug Robbins - Word MVP" wrote in message
...
YOU have to run the macro which is what " and with the result of
execution
of that mail merge on the screen,
run a macro containing the following code. " says. You must also
follow
exactly all of the steps in the process if you want it to work.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions
forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"AS" wrote in message
...
Hello,

I found this article with details on a macro to have an attachment
with a
ma
il merge:

http://word.mvps.org/faqs/mailmerge..Attachments.htm

It works nicely if you just run the macro but if you want to merge
fields
in
a mail merge document itself it will not do it.
I guess the part I am not getting is, I would like to run the mail
merge
and
have the macro run after the fields are populated in the word
document.
Th
is would fill the fields required with the pertinent information then
attach
the applicable attachment.
By just running the macro, the mail merge runs and attaches the
document
but
the fields in the word document only show the merge fields (not
actual
valu
es).
Does anyone know how to do this? The document says:


'Then execute the mail merge that you want to send out by email with
the
att
achments and with the result of execution of that mail merge on the
screen,
run a macro containing the following code. When the File open dialog
appear
s, select the file containing the table created by the catalogue type
mail
m
erge.'

From the sounds of this, the mail merge should run as normal then call
up
th
e macro to add the attachment. But, in my case, the mail merge runs
without
calling up this macro - any ideas?








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Word 2003 Issue S.Nicks Mailmerge 5 February 20th 09 02:55 AM
Mail Merge Toolbar Disabled Kara Mailmerge 2 July 26th 06 05:09 PM
Mail merge toolbar unavailable after SP3 R Scott Lowden Mailmerge 1 December 1st 04 07:24 PM
Mail Merge Problem Cindy M -WordMVP- Mailmerge 0 November 30th 04 06:25 PM
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements Mark V Mailmerge 8 November 30th 04 02:31 PM


All times are GMT +1. The time now is 03:50 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"