vb.nettemplatesoutlookoft

Open Outlook OFT template and populate recipient address


Working in a Windows Forms application and VB.NET.

I need to pop open an Office "New Message" window, populate the "To" address, and place an OFT template in the body of the message. I do not need to modify anything in the template.

To open the new message with the template, i could:

Diagnostics.Process.Start("MyFile.oft")

But this will not help with setting the TO address, or subject.

I also don't want to download any third party add-ons.

Any help??


Solution

  • You can use the Outlook Object Model and call Application.CreateItemFromTemplate. You can then set Subject/To/CC/BCC properties and the Recipients collection on the returned MailItem object.