locked
Can I programmatically access Outlook from a metro application RRS feed

  • Question

  • The way I read the various documentation on metro I can't access ActiveX from Metro and hence can't get an interface to Outlook.  I could be missing somehting in the documentation so any help is appreciated.  if I can't then I think Metro is fatally flawed.  Lots of apps need to access contacts, schedule events, mail stores and the like and I would think Microsoft would want us to be using OL (and through it Exchange) rather than GMail's REST APIs, which the metro runtime makes very convenient to access!
    Tuesday, September 27, 2011 11:39 AM

All replies

  • As you stated "can't access ActiveX". This is by design for Metro Apps for security reasons. You can't even use Flash or Silverlight wihin a HTML5/JavaScript Metro App. There currently isn't a shared Contact or Email API exposed through WinRT. I am too curious how they will handle this with the platform.

    You could write your own web service that exposes the necessary functionality and consume that service from your app.


    Microsoft MVP - Bing Maps
    Blog: http://pietschsoft.com | Web.Maps.VE - ASP.NET AJAX Bing Maps Server Control
    Tuesday, September 27, 2011 3:23 PM
  • Have you looked at the Web Service API exposed by Microsoft Exchange?

    http://msdn.microsoft.com/en-us/library/dd877012(v=EXCHG.140).aspx

     

    Wednesday, September 28, 2011 12:10 AM
  • yes I have and it is a pain to use compared to the OL ActiveX interface.  And the OL ActiveX interface works on older versions of OL.
    Wednesday, September 28, 2011 11:51 AM
  • Hi P Cause

    you can access your outlook.

    Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:mailID"));


    Thanks by Manivel

    • Proposed as answer by Manivelp Monday, April 2, 2012 12:07 PM
    Monday, April 2, 2012 12:07 PM
  • Hi,

    The above code is working fine. But how we can programmatically attach one image fail to the email client at
    the time of launching?

    Monday, May 28, 2012 11:48 AM
  • I have not tried this in a Metro style app but the mailto protocol takes an Attachment parameter:

    <a href='mailto:name@domain.com?Subject=SubjTxt&Body=Bod_Txt&Attachment=""C:\file.txt"" '>

    Two challenges you may face:

    1.  Gettting the full path of the file

    2.  Security restrictions accessing the file from outlook.

    Troubleshooting steps when trying this:

    Process Monitor will show file paths and problems

    Try and open the file in windows explorer directly to see if you have problems.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, May 29, 2012 7:39 PM
    Moderator
  • Thank you for your reply.

    In metro app, the "mailto:" is not accepting the attachement files. I have tried with below line of codes.

    Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:name@domain.com?Subject=SubjTxt&Body=Bod_Txt&Attachment=E:\Flowers.tif"));

    If we try above code in sample app, the attachement is not displaying.

    Whether we should set any other parameters?

    Wednesday, May 30, 2012 4:50 AM
  • Hi Gurushree,

    Sorry I lead you astray!  Some mail clients accept the attachment parameter however it is not an RFC standard for the mailto protocol and is considered a security breach by some clients.  You will not be able to add an attachment!

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, May 30, 2012 12:29 PM
    Moderator
  • Lets hope the Outlook metro app supports a share contract where you can easily share a precomposed email (with attachments). Lets see what the Release Preview in the next week offers new for share contracts.
    Wednesday, May 30, 2012 12:39 PM
  • Hi

    I am getting access denied when I use above code.is there any specific permission that I need to provide to do this.

    Thanks & Regards

    Ravi kumar B

    Wednesday, September 11, 2013 1:30 PM