OWA Web Part in an iFrame sample

I have not seen any examples of using OWA parts in an iFrame.  However, I wrote such a sample recently and wanted to share it.

The full OWA UI in an iFrame is not supported and its expected that doing so may fail at any given point and at different points depending upon the service pack and hotfix rollup.  You can use OWA Parts (a URL reference to a folder which displays content) in an iFrame.  OWA parts have several options for outputting the contents of a folder, however they do not provide the full functionality of OWA.   OWA Parts work off a URL which takes parameters to output the desired view of a folders contents rather than using a direct url reference.

I have seen some customers get OWA to mostly work in an iFrame by modifying the .js files to redo frame targeting – however, this is very much not supported in any way and any sort of update to the server may overwrite the .js file changes;  further, if there are issues with OWA, you may be required to reverse all such changes before support can be provided.

As an example, this:

https://127.0.0.1/public/test%20team%20calendar

Would need to be written something like this:

https://127.0.0.1/owa/?cmd=contents&module=PublicFolders&fpath=test%20team%20calendar

Here are some starting articles which you should review around developing with OWA in an iFrame or usage of OWA Web parts:        

Hosting Outlook Web Access in an IFrame Is Not Supported
https://technet.microsoft.com/en-us/library/ee221162(EXCHG.80).aspx

How to Use Outlook Web Access Web Parts
https://technet.microsoft.com/en-us/library/bb232199(EXCHG.80).aspx

ConvertId operation
https://msdn.microsoft.com/en-us/library/office/bb799665(v=exchg.150).aspx

Below is a sample iFrame I put together - it loads views of different folders for a mailbox and public folder.  You will need to change the server part of the URLs to match your server and create a folder called “abc” in your inbox and a folder called “test”and a calendar folder called “test team calendar”  in your public folder to use it.

<html>
<head>
    <title>test iframe with owa web part</title>
</head>

<body>

<iframe src="https://127.0.0.1/owa/?cmd=contents&fpath=inbox" name="OwaPartsSample" align=center height="500" width="900" scrolling="Auto">
</iframe>

<br><br>

<div align=center>
  <b>Test Links</b>
  <br>
  <br>

  <!-- reference Inbox -->
  <a href="https://127.0.0.1/owa/?cmd=contents&fpath=inbox" target="OwaPartsSample">Inbox</A><BR>

  <!-- reference Inbox/abc -->
  <a href="https://127.0.0.1/owa/?cmd=contents&fpath=inbox%2fabc" target="OwaPartsSample"> Inbox abc folder</A><BR>

  <!-- reference calendar -->
  <a href="https://127.0.0.1/owa/?cmd=contents&fpath=calendar" target="OwaPartsSample"> Calendar</A><BR>

  <!-- reference Public Folders/test -->
  <a href="https://127.0.0.1/owa/?cmd=contents&module=PublicFolders&fpath=test" target="OwaPartsSample"> Public Folder test folder</A><BR>

  <!-- reference Public Folders/test team calendar -->
  <a href="https://127.0.0.1/owa/?cmd=contents&module=PublicFolders&fpath=test%20team%20calendar" target="OwaPartsSample">Public Folder - Test Team Calendar</A><BR>

  <!-- reference Public Folders/test team calendar -->
  <a href="https://127.0.0.1/owa/?cmd=contents&module=PublicFolders&fpath=test%20team%20calendar&view=Weekly" target="OwaPartsSample"> Public Folder - Test Team Calendar - Weekly</A><BR>

  <!-- reference Public Folders/test team calendar -->
  <a href="https://127.0.0.1/owa/?cmd=contents&module=PublicFolders&fpath=test%20team%20calendar&view=monthly" target="OwaPartsSample">Public Folder - Test Team Calendar - Monthly</A><BR>

</div>
</body>

</html>

Remember that OWA will need to authenticate you, so you should have integreated authentication enabled when you use these URLs othersie you could well get an error.

Some Limitations:

Please note that item URLs are not supported in an iFrame. The OWA URLs you can get from EWS for displaying individual items are only supported when opened in new browser windows.  Only the URLs as described in the following article are supported:

How to Use Outlook Web Access Web Parts
https://technet.microsoft.com/en-us/library/bb232199(EXCHG.80).aspx

Please note that tasks webpart support not implemented in Exchange 2013.

Please note that OWA web parts from a shared Exchange Online server cannot be used in an IFRAME because all the needed settings to override click-jacking cannot be set.  One of the needed settings would cover all users on the server and it would affect more than one company.  If you want ant to use OA Web Parts in an IFRAME then you need to use a dedicated Exchange Online server or an on premise server.

OWA URLs and Identifiers:

It is extremely important to understand the different types of IDs which might appear in the URLs for OWA Web Parts.  These IDs are different for different versions of OWA.  Exchange 2013 uses EWS IDs for items and folders whereas 2010 and 2007 use their own version specific identifiers. You can use EWS's ConvertID method to convert between different identifiers - such as for converting from an EWS ID to a MAPI ID or an Exchange 2007/2010 OWA ID to an EWS ID.  Be sure to full read about ConvertID before doing any development with OWA URLs.  Be sure to note version specific information and particulars with public folders.

ConvertId operation
https://msdn.microsoft.com/en-us/library/office/bb799665(v=exchg.150).aspx

Converting EWS Identifiers in Exchange 2010
https://msdn.microsoft.com/en-us/library/office/bb856559(v=exchg.150).aspx

WebClientReadFormQueryString string and WebClientEditFormQueryString string return incorrect URLs in an Exchange Server 2013 environment
https://support.microsoft.com/en-us/kb/2888274
The format for OWA URLs changed in 2013; however, WebClientReadFormQueryString and WebClientEditFormQueryString don't reflect the change until you update to CU3 for 2013.  

WebClientReadFormQueryString
https://msdn.microsoft.com/en-us/library/office/dd877102(v=exchg.150).aspx
WebClientEditFormQueryString
https://msdn.microsoft.com/EN-US/library/office/dd899477(v=exchg.150).aspx

Also see:

Microsoft support policy for the customization of Outlook Web Access for Exchange
https://support.microsoft.com/KB/327178

OWA Single-sign-on support
https://blogs.msdn.com/b/webdav_101/archive/2012/08/07/owa-single-sign-on-support.aspx

Microsoft does not support using ISAPI extensions or filters to modify Outlook Web Access credentials on a server that is running Exchange Server
https://support.microsoft.com/kb/938609

OWA Web Parts not working in 2013 - "This content cannot be displayed in a frame"
https://blogs.msdn.com/b/webdav_101/archive/2015/01/20/owa-web-parts-not-working-in-2013-quot-this-content-cannot-be-displayed-in-a-frame-quot.aspx

[MS-OXWSCORE]: Core Items Web Service Protocol
https://msdn.microsoft.com/en-us/library/ee218241(v=exchg.80).aspx

Exchange 2013 OWA URLs
https://blogs.msdn.com/b/stephen_griffin/archive/2013/05/30/exchange-2013-owa-urls.aspx