0

I am trying to solve a problem with C#. I am able to import PST to outlook. Then use Import and Export option of Outlook to convert a folder within PST (chats) to CSV. how can i do the same using C#? If there is anyone who can help me with the code or give me link to any reference, it would be of great help.

Thanks

maverick
  • 129
  • 1
  • 3
  • 14

2 Answers2

0

It is not clear what exactly you want to export. Anyway, you may find the C# app automates Outlook (CSAutomateOutlook) sample project helpful.

It looks like you need to iterate over all folders and grab the required information. The How to: Enumerate Folders page is a good start for you.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Hi Eugene. I have a folder named Chats within PST. I need to convert that folder to CSV. I have around 100 PST's and each PST's has a folder named Chats. I need to repeat this process of creating CSV to each of these folders – maverick Dec 05 '14 at 11:53
  • How do you want to convert a folder to a csv file? I.e. what data do you need to extract? – Eugene Astafiev Dec 05 '14 at 12:14
  • Right now i am manually exporting the folder under a PST to CSV. The folder has all instant messages logs. To, Sent, Messages etc are some of the data in it. – maverick Dec 05 '14 at 12:16
  • The CSV does have them as headers and u have data under these headers. I wanted to automate this process – maverick Dec 05 '14 at 12:17
  • It looks like you need to iterate over all stores and folder to find the Chats folder and extract the data. – Eugene Astafiev Dec 05 '14 at 12:32
  • Yes Eugene.I am unable to proceed because of error at the line that i had mentioned above. The error is Object not found – maverick Dec 05 '14 at 15:31
  • Instead of accessing the Store object by its name you need to iterate over all stores. See [Stores](http://msdn.microsoft.com/en-us/library/office/ff867405(v=office.15).aspx) object page in MSDN for the sample code. – Eugene Astafiev Dec 05 '14 at 17:46
0

Try Pstxy

It provide a .NET API, which you can iterate over Outlook PST files, and extract mail contents you need.

neolei
  • 1,798
  • 2
  • 18
  • 32