Send Object Question

smpayne69

Registered User.
Local time
Today, 10:00
Joined
Dec 26, 2005
Messages
34
I have a macro that runs and report then uses the SendObject function to send the report via email. However, I want the entire process to be automated but am getting the following warning before it is sent, where I have to click YES:

"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"

Anyone out there that can help??

Thanks!
 
Have you tried to use docmd.sendobject? I use this and don't get the messages... Just a thought. :)
 
mmm

I will give it a try, thanks.
 
Did not work

Still giving me the same warning message. :(

Any other thoughts?
 
Hmm... Not really. Here's sample of one of mine:

DoCmd.SendObject acSendQuery, "selEmail_01", acFormatXLS, txtStringTo, txtStringCC, txtStringBCC, "Outstanding Parts Alert (" & rst!customer_id & ")", txtString, False

Looks like I use all the options...
 
Outlook "Object Model Guard" Security Issues for Developers

Interesting link. Thanks!
 
smpayne69 said:
I have a macro that runs and report then uses the SendObject function to send the report via email. However, I want the entire process to be automated but am getting the following warning before it is sent, where I have to click YES:

"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"

Anyone out there that can help??

Thanks!
I want to use the SendObject to attach two objects in the same email?

Can anybody help me?::(
 
SendObject Question

I need to send 2 objects in 1 email? please, please help!!!
 
You can't send multiple objects using sendobject. The code below will allow you to add multiple attachments to your message.

Code:
Sub SendMessage(DisplayMsg As Boolean, Optional AttachmentPath1 As String,
Optional attachmentpath2 As String)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

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

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("test@test.com")
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("test@test.com")
objOutlookRecip.Type = olCC

' Add the BCC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Sandra Daigle")
objOutlookRecip.Type = olBCC

' Set the Subject, Body, and Importance of the message.
.Subject = "This is an Automation test with Microsoft Outlook"
.Body = "This is the body of the message." & vbCrLf & vbCrLf
.Importance = olImportanceHigh  'High importance
' Add attachments to the message.
If Not IsMissing(AttachmentPath1) Then
.Attachments.Add AttachmentPath1
End If
If Not IsMissing(attachmentpath2) Then
.Attachments.Add attachmentpath2
End If
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
End With
Set objOutlook = Nothing
End Sub

Hay
 
Hay,

I use groupwise not outlook, can I use the same code? can I specify the table or query name on this code? how can I create the Sub sendMessage?

Thanks a bunch!!!
 

Users who are viewing this thread

Back
Top Bottom