Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 54745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:16:07+00:00 2026-05-10T17:16:07+00:00

I’m starting a project which requires reading outlook msg files in c#. I have

  • 0

I’m starting a project which requires reading outlook msg files in c#. I have the specs for compound documents but am having trouble reading them in c#. Any pointers would be greatly appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:16:08+00:00Added an answer on May 10, 2026 at 5:16 pm

    Here is my shot. This is an initial translation of this article.

    namespace cs_console_app {     using System;     using System.Runtime.InteropServices;     using System.Runtime.InteropServices.ComTypes;      [ComImport]     [Guid('0000000d-0000-0000-C000-000000000046')]     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]     public interface IEnumSTATSTG     {         // The user needs to allocate an STATSTG array whose size is celt.         [PreserveSig]         uint Next(             uint celt,             [MarshalAs(UnmanagedType.LPArray), Out]             System.Runtime.InteropServices.ComTypes.STATSTG[] rgelt,             out uint pceltFetched         );          void Skip(uint celt);          void Reset();          [return: MarshalAs(UnmanagedType.Interface)]         IEnumSTATSTG Clone();     }      [ComImport]     [Guid('0000000b-0000-0000-C000-000000000046')]     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]     interface IStorage     {         void CreateStream(             /* [string][in] */ string pwcsName,             /* [in] */ uint grfMode,             /* [in] */ uint reserved1,             /* [in] */ uint reserved2,             /* [out] */ out IStream ppstm);          void OpenStream(             /* [string][in] */ string pwcsName,             /* [unique][in] */ IntPtr reserved1,             /* [in] */ uint grfMode,             /* [in] */ uint reserved2,             /* [out] */ out IStream ppstm);          void CreateStorage(             /* [string][in] */ string pwcsName,             /* [in] */ uint grfMode,             /* [in] */ uint reserved1,             /* [in] */ uint reserved2,             /* [out] */ out IStorage ppstg);          void OpenStorage(             /* [string][unique][in] */ string pwcsName,             /* [unique][in] */ IStorage pstgPriority,             /* [in] */ uint grfMode,             /* [unique][in] */ IntPtr snbExclude,             /* [in] */ uint reserved,             /* [out] */ out IStorage ppstg);          void CopyTo(             /* [in] */ uint ciidExclude,             /* [size_is][unique][in] */ Guid rgiidExclude, // should this be an array?             /* [unique][in] */ IntPtr snbExclude,             /* [unique][in] */ IStorage pstgDest);          void MoveElementTo(             /* [string][in] */ string pwcsName,             /* [unique][in] */ IStorage pstgDest,             /* [string][in] */ string pwcsNewName,             /* [in] */ uint grfFlags);          void Commit(             /* [in] */ uint grfCommitFlags);          void Revert();          void EnumElements(             /* [in] */ uint reserved1,             /* [size_is][unique][in] */ IntPtr reserved2,             /* [in] */ uint reserved3,             /* [out] */ out IEnumSTATSTG ppenum);          void DestroyElement(             /* [string][in] */ string pwcsName);          void RenameElement(             /* [string][in] */ string pwcsOldName,             /* [string][in] */ string pwcsNewName);          void SetElementTimes(             /* [string][unique][in] */ string pwcsName,             /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pctime,             /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME patime,             /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pmtime);          void SetClass(             /* [in] */ Guid clsid);          void SetStateBits(             /* [in] */ uint grfStateBits,             /* [in] */ uint grfMask);          void Stat(             /* [out] */ out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg,             /* [in] */ uint grfStatFlag);      }      [Flags]     public enum STGM : int     {         DIRECT = 0x00000000,         TRANSACTED = 0x00010000,         SIMPLE = 0x08000000,         READ = 0x00000000,         WRITE = 0x00000001,         READWRITE = 0x00000002,         SHARE_DENY_NONE = 0x00000040,         SHARE_DENY_READ = 0x00000030,         SHARE_DENY_WRITE = 0x00000020,         SHARE_EXCLUSIVE = 0x00000010,         PRIORITY = 0x00040000,         DELETEONRELEASE = 0x04000000,         NOSCRATCH = 0x00100000,         CREATE = 0x00001000,         CONVERT = 0x00020000,         FAILIFTHERE = 0x00000000,         NOSNAPSHOT = 0x00200000,         DIRECT_SWMR = 0x00400000,     }      public enum STATFLAG : uint     {         STATFLAG_DEFAULT = 0,         STATFLAG_NONAME = 1,         STATFLAG_NOOPEN = 2     }      public enum STGTY : int     {         STGTY_STORAGE = 1,         STGTY_STREAM = 2,         STGTY_LOCKBYTES = 3,         STGTY_PROPERTY = 4     }      class Program     {         [DllImport('ole32.dll')]         private static extern int StgIsStorageFile(             [MarshalAs(UnmanagedType.LPWStr)] string pwcsName);          [DllImport('ole32.dll')]         static extern int StgOpenStorage(             [MarshalAs(UnmanagedType.LPWStr)] string pwcsName,             IStorage pstgPriority,             STGM grfMode,             IntPtr snbExclude,             uint reserved,             out IStorage ppstgOpen);          static void Main(string[] args)         {             string filename = @'f:\temp\treta2.msg';             if (StgIsStorageFile(filename) == 0)             {                 IStorage storage = null;                 if (StgOpenStorage(                     filename,                     null,                     STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE,                     IntPtr.Zero,                     0,                     out storage) == 0)                 {                     System.Runtime.InteropServices.ComTypes.STATSTG statstg;                     storage.Stat(out statstg, (uint) STATFLAG.STATFLAG_DEFAULT);                      IEnumSTATSTG pIEnumStatStg = null;                     storage.EnumElements(0, IntPtr.Zero, 0, out pIEnumStatStg);                      System.Runtime.InteropServices.ComTypes.STATSTG[] regelt = { statstg };                     uint fetched = 0;                     uint res = pIEnumStatStg.Next(1, regelt, out fetched);                      if (res == 0)                     {                         while (res != 1)                         {                             string strNode = statstg.pwcsName;                             bool bNodeFound = false;                              Console.WriteLine(strNode);                              if (strNode == '__substg1.0_0E04001E'                                 || strNode == '__substg1.0_0E1D001E'                                 || strNode == '__substg1.0_1000001E'                                 || strNode == '__substg1.0_1013001E')                             {                                 bNodeFound = true;                             }                              if (bNodeFound)                             {                                 switch (statstg.type)                                 {                                     case (int) STGTY.STGTY_STORAGE:                                         {                                             IStorage pIChildStorage;                                             storage.OpenStorage(statstg.pwcsName,                                                null,                                                (uint) (STGM.READ | STGM.SHARE_EXCLUSIVE),                                                IntPtr.Zero,                                                0,                                                out pIChildStorage);                                         }                                         break;                                     case (int) STGTY.STGTY_STREAM:                                         {                                             IStream pIStream;                                             storage.OpenStream(statstg.pwcsName,                                                IntPtr.Zero,                                                (uint)(STGM.READ | STGM.SHARE_EXCLUSIVE),                                                0,                                                out pIStream);                                              byte[] data = new byte[255];                                              pIStream.Read(data, 255, IntPtr.Zero);                                         }                                         break;                                 }                             }                              if ((res = pIEnumStatStg.Next(1, regelt, out fetched)) != 1)                             {                                 statstg = regelt[0];                             }                         }                     }                 }             }              Console.ReadLine();         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 148k
  • Answers 148k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you should take a look at the JavaScript… May 12, 2026 at 9:18 am
  • Editorial Team
    Editorial Team added an answer We provide a single file bootstrapper for retail distribution and… May 12, 2026 at 9:18 am
  • Editorial Team
    Editorial Team added an answer What you need is a method on your ShortUrlFunctions class… May 12, 2026 at 9:18 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.