none
Displaying Silverlight in Outlook Folder? RRS feed

  • Question

  • Hi all,

    When I try to set the WebViewURL of an outlook folder to a Silverlight application / website, why does it not display??

    For example: Set it to http://www.tjcombo.net and all I see is a blank white area. If I right click, it still shows 'Silverlight'

    This problem is solved, if I set it as say http://www.bing.com and then go to tjcombo from there.

    Why is it that redirecting to Silverlight works but not Silverlight directly?


    Wednesday, May 30, 2012 9:01 AM

Answers

  • Hi Prashanth,

    I tried to reproduce you issue via DamianD's suggest, it works fine. I use a iframe tag to embed the webset which you mentioned. Then link the iframe page to WebViewURL. Following is the snippet which I used:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using Office = Microsoft.Office.Core;
    using log4net;
    using MyLog4Net;
    
    namespace OutlookAddIn11
    {
        public partial class ThisAddIn
        {
            private ILog log = MyLog4Net.MyLog4Net.Generator1(
                AppDomain.CurrentDomain.BaseDirectory + "test.log",
                typeof(ThisAddIn), "DEBUG", true);
    
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                try
                {
                    Outlook.MAPIFolder target = Application.Session
                        .GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
                        .Folders["test"];
                    target.WebViewURL = http://localhost/testpage.htm;
                    log.Info("http://www.tjcombo.net/" + " has been loaded.");
                    target.WebViewOn = true;
                    log.Info("MAPIFolder test WebViewOn");
                }
                catch (Exception ex)
                {
                    log.Error(ex.Message + "\n" + ex.StackTrace);
                }
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
    
            #region VSTO generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InternalStartup()
            {
                this.Startup += new System.EventHandler(ThisAddIn_Startup);
                this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
            }
            
            #endregion
        }
    }

    This is the page on my local IIS:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    	<head>
    		<title>test</title>
    	</head>
    	<body>
    	    <iframe frameborder=0 width=600 height=400 src="http://www.tjcombo.net/"></iframe>
    	</body>
    </html>

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 31, 2012 1:48 AM
    Moderator

All replies

  • try setting url to normal page with embedded silverlight control (for example media player) - does it work?

    Wednesday, May 30, 2012 9:44 AM
  • Hi Prashanth,

    I tried to reproduce you issue via DamianD's suggest, it works fine. I use a iframe tag to embed the webset which you mentioned. Then link the iframe page to WebViewURL. Following is the snippet which I used:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using Office = Microsoft.Office.Core;
    using log4net;
    using MyLog4Net;
    
    namespace OutlookAddIn11
    {
        public partial class ThisAddIn
        {
            private ILog log = MyLog4Net.MyLog4Net.Generator1(
                AppDomain.CurrentDomain.BaseDirectory + "test.log",
                typeof(ThisAddIn), "DEBUG", true);
    
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                try
                {
                    Outlook.MAPIFolder target = Application.Session
                        .GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
                        .Folders["test"];
                    target.WebViewURL = http://localhost/testpage.htm;
                    log.Info("http://www.tjcombo.net/" + " has been loaded.");
                    target.WebViewOn = true;
                    log.Info("MAPIFolder test WebViewOn");
                }
                catch (Exception ex)
                {
                    log.Error(ex.Message + "\n" + ex.StackTrace);
                }
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
    
            #region VSTO generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InternalStartup()
            {
                this.Startup += new System.EventHandler(ThisAddIn_Startup);
                this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
            }
            
            #endregion
        }
    }

    This is the page on my local IIS:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    	<head>
    		<title>test</title>
    	</head>
    	<body>
    	    <iframe frameborder=0 width=600 height=400 src="http://www.tjcombo.net/"></iframe>
    	</body>
    </html>

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 31, 2012 1:48 AM
    Moderator
  • Thanks, Damian and Tom
    Thursday, May 31, 2012 5:52 AM