This is what you see when you click .msg file in SharePoint.
See there is no Open button and only choice remaining is to Save it first on your computer and then open it to view the message. This behavior is caused by SharePoint 2010 Browser File Handling which is set per Web Application.
Wouldn’t be nice to have a feature to open documents directly? There are two ways you can achieve this. I am detailing both steps below but my preferred and recommended approach is Method 2.
Method 1
- Open SharePoint 2010 Central Administration > Application Management > Manage Web Applications
- Select your Web Application and click General Settings in the ribbon
- Scroll down to Browser File Handling and select Permissive as shown below
- Click OK to save the settings
- Recycle the Application Pool for your selected Web Application
You should now be able to open .msg files.
Method 2
This is my preferred method and I would highly recommend that you follow this approach as it is also considered as a best practice. By using this method you will keep your Browser File Handling to Strict and will only allow certain types of files to be allowed e.g. .msg files in our case.
- Open IIS Manager
- Expand Sites and select your Web Application
- On your right pane, scroll down and double-click MIME Types
- Click Add from the Actions pane and enter the following
- File name extension: .msg
- MIME type: application/vnd.ms-outlook
- Click OK. Repeat this process in all web-front-end servers on your SharePoint farm
- Next copy the following code in Notepad and save it as powershell script with .ps1 extension. First replace YOUR WEB APPLICATION at the top of the script with the URL of your Web Application. In my case it is http://sp2010:1477
$webApp = Get-SPWebApplication http://sp2010:1477
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/vnd.ms-outlook")
{
$webApp.AllowedInlineDownloadedMimeTypes.Add("application/vnd.ms-outlook")
$webApp.Update()
Write-Host "application/vnd.ms-outlook added to AllowedInlineDownloadedMimeTypes"
}
- Open SharePoint Management Shell as an Administrator
- Go to the location where you have saved your powershell script and run it
You now need to run IISRESET on each web front-end server for these settings to be applied.
Now go back to your document library and click the .msg file. You will see an Open button which will allow you to open .msg files directly rather than saving them first.
Very Nice ! Thanks.
ReplyDelete