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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help emailing using vba through Outlook

Status
Not open for further replies.

rixx

IS-IT--Management
May 20, 2002
15
US
Hello,

I am trying to automatically email reports converted to .pdf files to the entire sales force. I have been able to generate the .pdf files and can email them just fine. However, prior to sending each email, an Outlook message box appears stating something like "an attachment is attempting to be automatically sent. This could be a virus, click Yes to send or click No to cancel. I have Norton AV but I disabled Virus check on outgoing emails for testing purposes.

Is this an Outlook setting, or something in the Registry? Can I bypass this message???

I am using Outlook 2002 and I have a reference to Outlook 10 Object library. I've been looking for a method i can use to bypass the message, but i haven't been able to. Code looks like:

Sub EMailFile( _
ByVal sMailTo As String _
, ByVal sMailSubj As String _
, ByVal sAttachFile As String)

Dim olApp As Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem

Set olApp = New Outlook.Application
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(Outlook.olMailItem)

With olMail
.To = sMailTo
.Subject = sMailSubj
.Attachments.Add sAttachFile
.ReadReceiptRequested = False
.Send
End With

End Sub

Is there something I can do to bypass that Outlook message box?

Thanks,

Rick
 
Hi Rixx,

Did you manage to get that box to disappear about the virus when are emailing through access?

I've got the same thing appearing and could dowith some help..

Neemi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top