Showing posts with label CreateObject. Show all posts
Showing posts with label CreateObject. Show all posts

Friday, 5 February 2016

How to Automate Outlook From a Visual Basic ApplicationIn Feburary 2016 05,

In Feburary 2016 05,
Create the Microsoft Outlook variable. This variable contains the functions you need to create and send a message. The following code creates the variable:Set outlook = CreateObject('Outlook.Application')
Set up the message variable. The message variable is later used to send the message to the recipient. The following code creates the message variable:Set msg = outlook.CreateItem(mailitem)
Set up your recipient, subject and message body. This is the main information contained in the Outlook message. The following code sets up this information:Set recip = .Recipients.Add('Joe Smith')
msg.Type = olBCC
msg.Subject = 'Test Outlook message'
msg.Body = 'Message body.'
Send the message. Sending the message is as simple as calling the 'Send' function. The following code sends the message to the recipient:msg.Send
In Feburary 2016 05,