L
lehainam
Dear all,
I have a macro that send data from Excel though Microsoft Outlook:
Sub Mail_With_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = Cells(2, 3)
strcc = ""
strbcc = ""
strsub = Cells(2, 1)
strbody = Cells(2, 4)
With OutMail
..To = strto
..CC = strcc
..BCC = strbcc
..Subject = strsub
..Body = strbody
..Send
End With
Application.SendKeys "%S"
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
But there is always a message to confirm your sending by press Yes or
No.
'The program is trying to automatically send an emai on your behalf.
'Do you want to allow this?
Could any one help me to skip this message or to press Yes
automatically when the message popups.
Thanks a lot!
Nam
I have a macro that send data from Excel though Microsoft Outlook:
Sub Mail_With_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = Cells(2, 3)
strcc = ""
strbcc = ""
strsub = Cells(2, 1)
strbody = Cells(2, 4)
With OutMail
..To = strto
..CC = strcc
..BCC = strbcc
..Subject = strsub
..Body = strbody
..Send
End With
Application.SendKeys "%S"
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
But there is always a message to confirm your sending by press Yes or
No.
'The program is trying to automatically send an emai on your behalf.
'Do you want to allow this?
Could any one help me to skip this message or to press Yes
automatically when the message popups.
Thanks a lot!
Nam