Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2006

Tip: Looking for answers? Try searching our database.

partially automate mailmerge to email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
christophe - 02 Feb 2006 12:40 GMT
HI,

I've setup a mailmerge document with a dbase table.
this table also contains an email adres.
Is there an easy way to already fill in the email in
the form which popups when hitting the button
"Merge to email" and also already choose "attachement" ?

kind regards
christophe

Signature

              \|||/
             (o o)
----ooO-(_)-Ooo-------------

Doug Robbins - Word MVP - 02 Feb 2006 16:02 GMT
Use the following code in a macro, substituting the relevant field name for
the email addresses:

With ActiveDocument.MailMerge
   .Destination = wdSendToEmail
   .MailAddressFieldName = "Email"
   .MailAsAttachment = True
   .Execute
End With

Signature

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

> HI,
>
[quoted text clipped - 6 lines]
> kind regards
> christophe
christophe - 03 Feb 2006 12:22 GMT
Thanks a lot  Doug Robbins,

It works perfect, only I get an error 5661
on the Execute line.
Because I don't need it, I've deleted it.
For me, when the proper values are already filled
in, that is more than enough.
The user will choose to click send or not.

One further question
can that macro automatically be done while opening
the doc.
Because know I've attached the macro to a button.
but I prefer to do it when the doc is opened ?

Thanks in advance
Kind Regards
christophe

Signature

              \|||/
             (o o)
----ooO-(_)-Ooo-------------

> Use the following code in a macro, substituting the relevant field name
> for the email addresses:
[quoted text clipped - 16 lines]
>> kind regards
>> christophe
Doug Robbins - Word MVP - 03 Feb 2006 18:48 GMT
That would necessitate you having:

1.    The data source already attached to the document

2.    The macro in the document.

Having the macro in the document will require that you respond to the Enable
macros in the document dialog box, so you are hardly gaining anything over
clicking on a button on a toolbar.

To prevent an error occuring if you were to click on the button when the
document was not a mailmerge main document with an attached datasource, you
probably should use:

With ActiveDocument
   If .MailMerge.State = wdMainAndDataSource Then
       .Destination = wdSendToEmail
       .MailAddressFieldName = "Email"
       .MailAsAttachment = True
   End If
End With

Signature

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

> Thanks a lot  Doug Robbins,
>
[quoted text clipped - 35 lines]
>>> kind regards
>>> christophe
christophe - 06 Feb 2006 08:22 GMT
Ok,

Didn't think of that.
thanks a lot.

regards
christophe
Signature

              \|||/
             (o o)
----ooO-(_)-Ooo-------------

> That would necessitate you having:
>
[quoted text clipped - 57 lines]
>>>> kind regards
>>>> christophe
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.