Quantcast
Channel: Outlook IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 33562

Sending a email and SENT property

$
0
0

Hi , I´m newbie with VBA and can´t find out why the following code is not updating the SENT property ...

I´m testing as EXCEL 2010 macro, after Outlook is open I send the email and seems SENT is not updated !

Sub outlook()

  Dim oout As Object
  Dim omsg As Object

  Set oout = CreateObject("Outlook.Application")
  Set omsg = oout.CreateItem(olMailItem)
  Set myRecipient = omsg.Recipients.Add(" JOHN ")
  omsg.Subject = "Teste Objeto Outlook no Macro Excel"
  omsg.Display
  If omsg.Sent Then
     MsgBox (" Sent ")
  Else
     MsgBox (" Not Sent ")
  End If
  Set oout = Nothing
  Set omsg = Nothing
 End Sub

Thanks,

Hu


Viewing all articles
Browse latest Browse all 33562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>