Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This action cannot be completed because the Microsoft Outlook applicat

Status
Not open for further replies.

jrollins

MIS
May 7, 2003
24
0
0
US
When attempting to send an e-mail using the following code, Outlook hangs up when the .Send attempts to execute. After clicking anywhere on my open Access form, I receive this error message :

This action cannot be completed because the Microsoft Outlook application (Microsoft Outlook) is not responding. Choose Switch To to activate Microsoft Outlook and correct the problem.

After clicking on 'Switch to' (and the Outlook Security Update warning) the e-mail is successfully transmitted. Subsequent attempts to send e-mails do not produce this error. In fact, if Outlook is closed prior to opening Access, I don't get the error

CODE-

Public Sub SendMessage(Optional AttachmentPath)

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(0) 'olMailItem

' Set To, CC, BCC, Subject, Body, and Importance of the message.
objOutlookMsg.To = DLEC_TO
objOutlookMsg.CC = DLEC_CC
objOutlookMsg.BCC = DLEC_BCC
objOutlookMsg.Subject = DLEC_SUBJECT
objOutlookMsg.Body = DLEC_MESSAGE & vbCrLf & vbCrLf
objOutlookMsg.Importance = 2 'High importance

objOutlookMsg.Send

'Close Outlook
objOutlook.Quit

Set objOutlookMsg = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top