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 / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Automating Mail Merge/Sending to Email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnJohn - 23 Aug 2005 22:01 GMT
Hello.

I am using the Visual Basic and the Microsoft Word 11.0 Object Library to
automate mail merge and send the output via email.  I have almost everything
working.  I used Microsoft's examples to figure out how to do this.  I ran
the following example code right from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd11/html/wo
proMailAddressFieldName1_HV05211939.asp
:

With Documents("FormLetter.doc").MailMerge
   .MailAddressFieldName = "Email"
   .MailSubject = "Amazing offer"
   .Destination = wdSendToEmail
   .Execute
End With

...having filled in all the merge fields appropriately.  Upon the .Execute
call, I get the following prompt:

"A program is trying to automatically send e-mail on your behalf.
Do you want to allow this? If this is unexpected, it may be a virus and you
should choose "No"."

I click "Yes" to allow the email.  It APPEARS that it's working, but no
email is ever sent or received by any of the recipients.  I assume that it's
using Outlook to send the email, and none of the messages ever appear in the
out box or in sent messages, and none are ever received.

Am I missing something?

Thanks for sitting there and reading this long email!

John
Jezebel - 23 Aug 2005 23:49 GMT
You need to clear the Outlook message cache before calling the mail
function. Insert this line immediately before the MailMerge statement:

Kill "C:\Program Files\Microsoft Office\OFFICE11\*.*"

> Hello.
>
[quoted text clipped - 32 lines]
>
> John
JohnJohn - 24 Aug 2005 00:01 GMT
Ummm...that's where a lot of application extensions, and WINWORD.EXE are,
among many other important files.  You sure you got the right directory or
are you yanking my chain?  :)

John

> You need to clear the Outlook message cache before calling the mail
> function. Insert this line immediately before the MailMerge statement:
[quoted text clipped - 37 lines]
> >
> > John
Jezebel - 24 Aug 2005 01:03 GMT
Just try it. You'll be fine.

> Ummm...that's where a lot of application extensions, and WINWORD.EXE are,
> among many other important files.  You sure you got the right directory or
[quoted text clipped - 47 lines]
>> >
>> > John
JohnJohn - 24 Aug 2005 15:17 GMT
Anyone have any *helpful* advice as opposed to *malicious*.  Good thing most
of us in here are smarter than you, Jezebel.

> Just try it. You'll be fine.
>
[quoted text clipped - 49 lines]
> >> >
> >> > John
Doug Robbins - 24 Aug 2005 21:23 GMT
Jezebel is a knowledgable and frequent poster to these newsgroups and is not
known for providing *malicious* advice as opposed to *helpful* advice.

I can't pass any comment on what he suggested you try other than, provided
you do not have any unsaved work at the time that you try it, it can't do
any harm.

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

> Anyone have any *helpful* advice as opposed to *malicious*.  Good thing
> most
[quoted text clipped - 61 lines]
>> >> >
>> >> > John
JohnJohn - 24 Aug 2005 22:16 GMT
Uh.  No.  You guys are nuts if you want me to delete Microsoft Word and all
its supporting DLLs and other extensions in order to make mail merge work.  
lol

> Jezebel is a knowledgable and frequent poster to these newsgroups and is not
> known for providing *malicious* advice as opposed to *helpful* advice.
[quoted text clipped - 68 lines]
> >> >> >
> >> >> > John
Jezebel - 24 Aug 2005 23:28 GMT
As perhaps you've worked out by now, the consensus is that someone who wants
to send bulk emails with a subject line 'amazing offer' is the very dregs of
humanity.

May your haemorrhoids hang like grapes!

> Uh.  No.  You guys are nuts if you want me to delete Microsoft Word and
> all
[quoted text clipped - 81 lines]
>> >> >> >
>> >> >> > John
John - 10 Sep 2005 01:48 GMT
PMFJI, and so late at that, but, Jezebel, I think you might owe the OP an
apology.

The code he quotes is from the page he pointed at.  Word for word.

> As perhaps you've worked out by now, the consensus is that someone who
> wants to send bulk emails with a subject line 'amazing offer' is the very
[quoted text clipped - 95 lines]
>>> >> >> >
>>> >> >> > John
 
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.