2

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?

sd_dracula
  • 3,796
  • 28
  • 87
  • 158
  • There are various articles which explain the similarity between .OFT and .MSG files. See a [related post](http://stackoverflow.com/questions/7957827/is-there-a-difference-between-the-outlook-msg-and-oft-file-formats?rq=1). I figure that you can read the .OFT file like a .MSG file, change the body and save back it to file. – Axel Kemper Oct 14 '16 at 09:07

1 Answers1

3

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)).

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78