none
Opening a document (which resides on a SharePoint site with Claims Auth) from a Word 2007 Addin RRS feed

  • Question

  • We are using the following call to open a word document from our Word2007/2010 AddIn.

    Globals.ThisAddIn.Application.Documents.Open(filePath);

    In our case the document resides on a SharePoint site which uses Claims based authentication.

    In Word 2010 a login prompt is displayed to the user when this call is made. (This is the expected behaviour).

    In Word 2007 no prompt is displayed and the addin code crashes.

    If I manually (interacting with word without code) attempt to open a document in Word 2007 which resides on the server I get a login prompt.

    Is there anything special I need to do in order to get Word 2007 to display the user a login prompt?

    Any help is appreciated.

    Thanks!

    Moe


    Mohamed Salti

    Wednesday, November 14, 2012 9:31 PM

Answers

  • suprisingly i managed to reproduce your issue - office 2007 does not display window to provide credentials, even with Sharepoint integration enabled and installed in office. Since you are doing this from code, i guess you have to compensate for that and do it yourself.  Send options call, check response for 403 and http header 'X_Forms_Based_Auth_Required' and if necessary, display embedded IE in some window with url from that header.

    • Marked as answer by Mohamed Salti Thursday, November 22, 2012 9:07 PM
    Tuesday, November 20, 2012 9:04 AM
  • The workaround implemented was to show a web browser window (from Addin code) directed at the sharepoint site. if the user is already authenticated (able to browse to the sharepoint site) the web browser window is closed, otherwise the user logins and and we continue our processes.

    Thanks for your help Damian!


    Mohamed Salti

    • Marked as answer by Mohamed Salti Thursday, November 22, 2012 9:07 PM
    Thursday, November 22, 2012 9:07 PM

All replies

  • Hi Mohamed,

    Thanks for posting in the MSDN Forum.

    I will involve some experts into your thread to see whether they can help you. There might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


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

    Thursday, November 15, 2012 5:03 AM
    Moderator
  • please verify using fiddler on machine with office 2007 that word actually checks sharepoint server with OPTIONS http verb - this is used to determine if site supports claims authentication. Maybe you have browser windows service stopped?
    Thursday, November 15, 2012 8:12 AM
  • Hi Damian,

    I have verified that the OPTIONS verb is being sent over to the server. The response from the server is a 403.

    I also noticed this header entry in the response: X-MSDAVEXT_Error: 917656; Access denied. Before opening files in this location, you must first browse to the web site and select the option to login automatically.

    The exact same code runs in Word 2010 on the same machine.

    Thanks for your help.


    Mohamed Salti

    Monday, November 19, 2012 7:28 PM
  • there should albo be a second http header that provides link to web page to show. please verify that it is also returned for office 2007. And i;m not sure about that 403, i vaguely rememeber that it should be 200, but maybe i;m wrong, i will check this in few hours and let you know again.
    Tuesday, November 20, 2012 5:00 AM
  • suprisingly i managed to reproduce your issue - office 2007 does not display window to provide credentials, even with Sharepoint integration enabled and installed in office. Since you are doing this from code, i guess you have to compensate for that and do it yourself.  Send options call, check response for 403 and http header 'X_Forms_Based_Auth_Required' and if necessary, display embedded IE in some window with url from that header.

    • Marked as answer by Mohamed Salti Thursday, November 22, 2012 9:07 PM
    Tuesday, November 20, 2012 9:04 AM
  • The workaround implemented was to show a web browser window (from Addin code) directed at the sharepoint site. if the user is already authenticated (able to browse to the sharepoint site) the web browser window is closed, otherwise the user logins and and we continue our processes.

    Thanks for your help Damian!


    Mohamed Salti

    • Marked as answer by Mohamed Salti Thursday, November 22, 2012 9:07 PM
    Thursday, November 22, 2012 9:07 PM