sd_dracula
sd_dracula

Reputation: 3896

Modifying Outlook OFT files via C#

My scenario is that I have a huge number of .OFT, Outlook Template files, around 1000.

They all need to be edited and saved with new contact information (updating the To and CC lines).

I have worked with the Outlook C# API in the past but never with .oft files. Is it possible to read the .oft files, modify that needs to be modified and then save back to .oft via the API?

Upvotes: 2

Views: 1515

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66235

You can

  1. Create a new item in Outlook using Application.CreateItemFromTemplate, modify it, then save as an OFT file (MailItem.SaveAs(..., olTemplate)).

  2. Use Redemption (I am its author) to directly open OFT files using RDOSession.GetMessageFromMsgFile, modify them, then save as a new files (RDOMail.SaveAs(..., olTemplate)).

Upvotes: 3

Related Questions