Office Automation for Outlook

It’s nice to see that Xojo has an Office automation plugin available, but it only supports Word, Excel, and PowerPoint. What about other Office apps, or more significantly, Outlook? I need the ability to control Outlook from Xojo, and not just sending emails from Xojo…true access to the object model.

Thanks!

Actually, never mind. I seem to have figured it out. Using OLEObject and with some experimentation, I seem to be able to control Outlook, just not using the Xojo plugin.

// Declare object
dim objApp as OLEObject
dim objMail as OLEObject
dim objRecipients as OLEObject

// Outlook application object
objApp=new OLEObject(“Outlook.Application”)

// Create mail item object
objMail=objApp.CreateItem(0)

// Recipients object
objRecipients = objMail.Recipients.Add(“someone@gmail.com”)

// Body format
objMail.BodyFormat(2) 'HTML Format (olFormatHTML)

// Subject line
objMail.Subject = “Subject Test”

// Message body
objMail.Body = “This is a test of the body”

// Show Outlook message window
objMail.Display()