G
Guest
I need to send a export table with a macro, but all time appear this message:
A program is trying to send mail using Item.Send
i make this macro:
Sub a()
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim sAttachment As String
sAttachment = "C:\autoexec.bat"
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
oMailItem.to = "(e-mail address removed)"
oMailItem.subject = "Test"
oMailItem.Body = "Body Test"
'oMailItem.Display
oMailItem.Save
oMailItem.SEND
oNameSpace.LOGOFF
End Sub
but the warning pop up every time.
Some one can help me ?
A program is trying to send mail using Item.Send
i make this macro:
Sub a()
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim sAttachment As String
sAttachment = "C:\autoexec.bat"
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
oMailItem.to = "(e-mail address removed)"
oMailItem.subject = "Test"
oMailItem.Body = "Body Test"
'oMailItem.Display
oMailItem.Save
oMailItem.SEND
oNameSpace.LOGOFF
End Sub
but the warning pop up every time.
Some one can help me ?