S
Smogerp
I am trying to find a way around the pop-up messages from Outlook for
automatically trying to send an e-mail from code.
I have tried the sendobject property along with the following code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim objOutlookErrors As Outlook.Exception
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(strRecipient)
objOutlookRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = strSubject
' Add attachments to the message.
Set objOutlookAttach = .Attachments.Add(strFaxFile)
.Send 'Send the email
End With
When it hits any of the processes dealing with the objOutlookMsg, the
pop-up warning messages appear. Is there ways around this. I will be
sending mail merged documents initiated from Access97 into Word97.
The application saves the mail merged document down to the Users C:\
drive. The attachment then pulls from the location and sends to ONE
common email address.
Any suggestions?
Thanks in advance.
Phill
automatically trying to send an e-mail from code.
I have tried the sendobject property along with the following code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim objOutlookErrors As Outlook.Exception
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(strRecipient)
objOutlookRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = strSubject
' Add attachments to the message.
Set objOutlookAttach = .Attachments.Add(strFaxFile)
.Send 'Send the email
End With
When it hits any of the processes dealing with the objOutlookMsg, the
pop-up warning messages appear. Is there ways around this. I will be
sending mail merged documents initiated from Access97 into Word97.
The application saves the mail merged document down to the Users C:\
drive. The attachment then pulls from the location and sends to ONE
common email address.
Any suggestions?
Thanks in advance.
Phill