Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Behavior of Word mail merge to e-mail from Access

Posted on 2006-11-19
3
Medium Priority
?
1,343 Views
Last Modified: 2007-12-19
Hello - I worked up a very basic routine (code below) to mail merge to either a new Word doc or to e-mail, and I'm wondering if what I'm seeing is normal:

1) I'm getting prompted once about "A program is trying to access e-mail addresses...", and then again about "A program is trying to automatically send e-mail..." for EVERY e-mail in the mail merge result. Is this normal ??? Any way to prevent this?

2) It looks like these e-mail's just sit in my Outbox unless Outlook is open at the time I run the mail merge. Is this "by design"? Is there some way I can force the messages to go out automatically?

Thanks

Mark

**************

Public Function MergeIt(Dest As String)

    Dim objWord As Word.Document
   
    Set objWord = GetObject("C:\MailMerge\MailMerge.doc", "Word.Document")
   
    ' Make Word visible.
    objWord.Application.Visible = True
   
    ' Set the mail merge data source
    objWord.MailMerge.OpenDataSource Name:="C:\MailMerge\MailMerge.mdb", LinkToSource:=True, AddToRecentFiles:=False, _
       SQLStatement:="SELECT * FROM [tblMailMerge]"
   
    Select Case Dest
       Case "print"
           objWord.MailMerge.Destination = wdSendToNewDocument
       Case "email"
            ' Execute the mail merge.
            objWord.MailMerge.MailSubject = "Please Read me!"
            objWord.MailMerge.MailFormat = wdMailFormatPlainText
            objWord.MailMerge.MailAddressFieldName = "EMailAddr"
            objWord.MailMerge.Destination = wdSendToEmail
    End Select
             
    objWord.MailMerge.Execute
   
    Set objWord = Nothing
   
    MsgBox "Finished..."

End Function
0
Comment
Question by:mlagrange
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:GreymanMSC
ID: 17976789
Oh, yes, it is now normal behaviour.

Welcome to Outlook 2002+.  

In an attempt to prevent email viral propogation, Outlook now refuses to allow automated email generation without explicit user interation.  Which is annoying when it's your own code, but sensible.
0
 
LVL 16

Accepted Solution

by:
GreymanMSC earned 2000 total points
ID: 17976915
PS: For further information on the Object Model Guard, check this link ( http://www.outlookcode.com/d/sec.htm ).

0
 

Author Comment

by:mlagrange
ID: 17978285
Ok, thanks for the link

Any idea about the second part (messages sitting in the Outbox)?

Thanks

Mark
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question