Starting Outlook and having an email pre-populated from command line

2015. 8. 10. 14:02Windows


http://stackoverflow.com/questions/248569/starting-outlook-and-having-an-email-pre-populated-from-command-line


Set olApp = CreateObject("Outlook.Application")
Set olMsg = olApp.CreateItem(0)

With olMsg
  .To = "test@testing.com"
  '.CC = "cc@testing.com"
  '.BCC = "bcc@testing.com"
  .Subject = "Subject"
  .Body = "Body"
  .Attachments.Add "C:\path\to\attachment\test.txt"

  .Display

  .Send


End With


https://www.add-in-express.com/outlook-security/index.php


OlSecurityManager.DisableOOMWarnings = True
On Error Goto Finally
' ... any action with protected objects ...
Finally:
OlSecurityManager.DisableOOMWarnings = False