Home » Sharepoint 2010

msg files



Can't open msg files from sharepoint I set the browser file handling to permissive but still can't select open only save?



1 Answer Found


Answer 1

Although your web application has "Browser File Handling" set to "Permissive" it is still possible that the document library in which your .msg files are stored has its "BrowserFileHandling" property set to "Strict". Please take a look at this post http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010setup/thread/95a9f8fa-3da6-4bb7-9983-2102910ff4aa where I offered a way through PowerShell to check the document library "BrowserFileHandling" property and change it to "Permissive" if necessary. The linked post is in reference to PDF files, however it is the exact same issue you are expeeriencing with .msg files.

I hope this helps.


Search for  msg files


Hi All,

My requirement is as follows.

I have a document library to which users will upload .eml files.On the itemadded event of this doc lib, i'll have to convert the eml file to .msg file.

Any help on ways to achieve this is appreciated.


Anyone out there know of any way to convert .msg files into PDF files using C#.

I did a quick search on google but most methods seems to require third party softwares which i need to purchase.

I only needed to do this in a one off fashion so am not considering purchasing.

Any other methods available.

I tried reading existing .msg into streams and then creating pdf file from stream but that didn't work. When i opened the file adobe dont recognize it.







I'm trying to get the msg file of the currrent MailItem, how can I do that?

for the moment, I have this


(this.Context as InspectorClass).CurrentItem as MailItem;

to get the current MailItem

but from there I would like to get the msg file as Stream...

how can I do that ?


Thx in advance


To Whom It May Concern

I am using a WPF User Control hosted in a ElementHost control of a Windows Form. I am using a DevExpress.Xpf.LayoutControl WPF class as the WPF Element and when I move the mouse on the UserControl I receive the System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) unhandled exception. I am wondering is there a known issue with Mouse Events on hosted WPF forms?

yours sincerely

Craig Hoy


i have several saved files .MSG emails in my PC folders under the  Outlook 2007(Windows XP)

i have Form Region an Outlook 2007

Error:  1.  open Outlook 2007

2. open  file.msg -

3. close file.msg

4. open file.msg - error cant open file,  file in use

if  not open outlook2007 all OK! open file.msg, close, open


I  want to read a msg file stored on my hard disk using C# and display it in HTML format in a browser(basically i want to preview it)

I can create a .msg file  (using CreatItem) but how do I read an existing file ?

I have the following environment

1. Windows 2008 64 bit
2. SQL Server 2008 Enterprise 64 bit

can you please tell me where I can find a 64 bit compatibile version of an iFilter for .msg files?

I installed Windows 2003 SDK on my machine and after which I got a directory called "Filters" in the "Microsoft Shared" Directory.
here is a file called msgfilt.dll is this the right one for filtering .msg files?

Please confirm.


We have developed a protocol handler for an email store which is very similar

to that of Outlook’s MAPI protocol handler. Our email store can have emails

as well as their attachments indexed.

In Vista, we have problems in getting the preview pane working for Outlook

(.msg) files. The preview handlers for all other standard types (.doc, .xls, .ppt,

.txt etc.) like are working fine. We just want to use an existing preview

handler for .msg files.

So, what we done is a two step process that has been mentioned on MSDN

and various forums.

1.In IShellFOlder::GetUIObject() we handle IID_IQueryAssociations as

CComPtr<IQueryAssociations> spqa;
AssocCreate(CLSID_QueryAssociations, __uuidof(IQueryAssociations), &spqa);

// For Word files, we pass ".doc", for text files ".txt" etc.

// Here we are passing the value for .msg files

spqa->Init(0, L"MAPI/IPM.Message", NULL, NULL);

spqa->QueryInterface(riid, ppvReturn);

2.In IShellFolder::BindToObject() we return IStream of our file (.doc, .xls, .ppt, .txt etc)

Step 1 and 2 above works fine for all other file types (except .msg) for which there is an existing preview handler available,

which is essentially the key value of {8895b1c6-b41f-4c1c-a562-0d564250836f},

available under the HKCR\<File Ext>\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}.

For a .msg file the type is a MAPI/IPM.Message, whose preview handler is available,

as there is a key value for it under the key


But as mentioned in point 1 while handling IID_IQueryAssociations we have also tried

passing “.msg” and “Outlook.File.msg” instead of “MAPI/IPM.Message

but IShellFOlder::BindToObject is never called for an IStream.

Using the Task Manager we have observed that prevhost.exe (a process for hosting

preview handlers) does get loaded with the DLL mssvp.dll.

Are we using the right preview handler for .msg files?


I want to preview outlook files(*.msg) in my own program. When I create instance using '435fdba0-964c-43a7-8aff-cc94e21b2249'. It always prompt a warning dialog and tell me  "Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client". I use the same way to preview word ,excel and ppt files. All of them are OK. Only msg files cannot be previewed. Do you know the reason? Or anyother ways to preview msg files. The followings are some codes I used.


string CLSID = "435fdba0-964c-43a7-8aff-cc94e21b2249";

            Guid g = new Guid(CLSID);

            Type a = Type.GetTypeFromCLSID(g, true);

            object obj = Activator.CreateInstance(a);

            IInitializeWithFile fileInit = obj as IInitializeWithFile;
            IInitializeWithStream streamInit = obj as IInitializeWithStream;
            bool isInitialized = false;
            if (fileInit != null)
              fileInit.Initialize(fileName, 0);
              isInitialized = true;
            elseif (streamInit != null)
              COMStream stream = new COMStream(File.Open(fileName, FileMode.Open));
              streamInit.Initialize((IStream)streamInit, 0);
              isInitialized = true;


As part of a web site I allow users to store documents in SQL Server 2000 using an Image column on a table. After the file is saved the user can open the document through the browser. This works great for most file extensions such as ".XLS" or ".DOC" but fails when attempting to open ".MSG" files (saved outlook messages). XLS documents will open in Excel and DOC documents open in Word, but MSG documents open in Notepad and display what appears to be binary data. I'm trying to figure out if this is a SQL Server issue or some sort of ASP/ASP.NET webserver issue.

If I attempt to open an MSG file stored directly on the web server, the file opens correctly using the "Microsoft Outlook View Control", but when attempting to open the same file saved in SQL Server, it attempts to open in notepad.

Any ideas?


I'm working on a process where I have a bunch .msg files on a file system that I'm absorbing into a memory through a migration application.  I'm wanting to then import these messages into Outlook itself or a pst file for archiving to an email repository.  The problem that I'm running into is that I need to import these messages as is (so I want to keep everything about the message the same body, send date time, received data time etc.).  I need to accomplish this using MAPI but I have yet to find a way to import these existing messages.  All I've been able to do is create a new message item (MailItem) set its attributes and then save to a folder.



I am building an Outlook addin using c# VS2010. I have outlook 2010. In my add in, I move emails from outlook to a database or network folder and back again. I have built custom panes in my code and can show all emails taken out of outlook in a treeview on the custom pane with the list of emails shown in another custom pane. However , this is not what I really wanted to do. I want to show the data in an explorer pane so when the user clicks on a node in my customised pane, I can show all the details of emails stored in the database. Can this be done? I know that all explorer windows have an associated outlook folder, but in this case there isn't one. I just want to dislay the emails I have moved to my add in.





Does anyone know a way of how to create a single pdf file from a .msg file I have on disk (so preferrably attachments of the mail inside the pdf if this is possible)?

I would need this from within code (c#).




I am writing .msg files from VC++ using StgCreateDocfile routines, using the MS-OXMSG as a guideline.

The .msg files can be opened in Quick View Plus and other viewers, but Outlook will not open them, saying "Cannot Start Microsoft Office Outlook.  Cannot Read Item" when I double-click on the .msg file.

I've been dumping the Storage's various contents, and can't figure out which particular parts Outlook does not like.

Comparing with a "good" .msg file, the "__properties_version1.0" items for unicode strings (type 0x001f), the "length" on good .msg files are 2 + the actual length of the stream.  I changed my .msg files to do the same, but they are still corrupt.

Does anyone have experience with writing .msg files?  (I can send the "corrupt" .msg file if anyone is willing to have a look!)
Any suggestions what to try?
I've been deleting sections from the .msg file to see if any particular section is bad.

One problem I just found is the need for PR_STORE_SUPPORT_MASK,
I happened to stumble upon these pages:  http://support.microsoft.com/kb/884671, http://msdn.microsoft.com/en-us/library/cc815750.aspx
This fixes some of the .msg files.

Are there any other required field values?  (The ANSI emails do not open in Outlook, but they open in most viewers)

Is it possible to create an .MSG file server side using ASP.NET and then send the file to the client? My specific need is to create emails automatically using data from the database and then give the users the ability to review the email prior to sending it. As opposed to automatically sending the email. I'd use the mailto: hyperlink, but the body could be rather large and it would cause the page to bloat. Multiple records will be displayed on a page.


We are using outlook automation to print .msg files. Now , It turned out that Outlook doesnt print BCC fields at all.

Is there any way to print BCC fields using Outlook Automation by any chance ?


thanks & regards





Can't open msg files from sharepoint I set the browser file handling to permissive but still can't select open only save?


I'm trying to create an msg file (just simple stuff inside, basic html or and image) but this should run without Outlook installed. So, no MAPI automation.

Any pointers or ideas ?

Thanks in advance.


I am working on a project where we are receiving msgs in HL7 2.3 version  in BizTalk Server 209 Other hand i have more than one endpoints to whom i have to deliever same msgs in HL7 2.5 Version? One way to do that i know is the mapping but that approach is very tedius and lengthy and not secure either. I am saying this because i am talking about msgs which have more then 20-25 segments with each segment having multiple fields in it. Moreover i have different types of msgs which all have the same above mentioned structure. So, to map each segment  plus each field inside that segment manually is almost impossible. Does anybody know that If BizTalk Server 2009 has any automatic functionality or trigger or event to do the mapping between two HL7 msg versions? If yes then please send me the link of the document or solution or something..

Thank You,

Umang Desai (Programmer/Analyst)



I need to convert MSG files to PDF through an automation process.

I first thought of opening the email in Outlook and saving it as a
MSG file and then to convert the file to PDF

I've also been looking at Outlook's SaveAs method but the warning
message that pops up requires user intervention and that's no good for
my solution.

Please help me.



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure