none
Storing/retrieving documents to/from an oAuth-secured repository using Office.js RRS feed

  • Question

  • I am trying to wrap my head around the new world of Javascript-centric "Apps for Office" development but need some guidance.  I currently maintain several VSTO apps that integrate inside of Word, Outlook, Excel and PowerPoint and provide a means of storing/retieving content/documents directly to/from an oAuth-secured content management repository.  While these Office addins work acceptably, they require significant effort to deploy and maintain therefore I would like to rewrite them as Javascript "Apps for Office".  That said, from reading the online docs and looking over the relatively few relevant code samples available, it is not clear to me whether or not what I'm trying to do is feasible in this programming model.  Has anyone out there any experience loading or saving documents (e.g. .docx, .pptx, .xlsx files) from inside a Javascript Office addin?

    Thanks in advance for any-and-all assistance.

    Friday, October 14, 2016 4:45 PM

Answers

  • Hi Lloyd,

    >> The programming model must support the ability to authenticate itself against a 3rd-party system secured with oAuth

    For this requirement, you could refer the link below:
    # OfficeDev/Word-Add-in-AngularJS-Client-OAuth
    https://github.com/OfficeDev/Word-Add-in-AngularJS-Client-OAuth

    For your first and second requirements, they are impossible with Office.js API. If these are new features you want to include in the future, I would suggest you submit a feedback in the link below:

    Reference: http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, October 18, 2016 5:19 AM

All replies

  • Hi LCharlier,

    What function do you want to achieve by Office add-ins which is app for office? What do you mean by loading or saving documents? If you want to load a new document or save the current document to another place by Office add-ins. I think it is impossible. As my understanding, Office add-ins is used to interop with Office content like getting or setting data in document.

    If you want to get or set the data in document, I think you could try

    # Read and write data to the active selection in a document or spreadsheet

    http://dev.office.com/docs/add-ins/develop/read-and-write-data-to-the-active-selection-in-a-document-or-spreadsheet

    I am not sure what the function of your oAuthsecured is, for calling function from other places, I think you could consume your function by Web api, and then call it from Office add-ins, you could refer the link below:

    # Office Add-in: Create a web service for an Office Add-in using the ASP.NET Web API

    https://dev.office.com/code-samples-detail/5784

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, October 17, 2016 5:26 AM
  • Edward,

    Thank you for the thoughtful reply.  Per your questions, perhaps I should elaborate a bit as to what I am trying to do...

    We currently have a document management system in-house that is secured using oAuth authentication (specifically ASP.NET Identity).  Like most document/content management solutions, the system provides document-centric functionality such as checkin, checkout, access control, automatic versioning, workflow, etc...  In the past, we have developed and deployed several application integrations for Word, Excel, PowerPoint, Outlook, AutoCAD, MicroStation, et al... enabling users of those applications to login to the document management system and subsequently load/save documents to/from that system directly from within the applications themselves.  On the Office side, these solutions were built using .NET and VSTO.  While these integrations worked acceptably, they were a thick-client only solution, they only worked with the thick-client versions of Office and they required the user to run an installer program.  With the advent of "Apps for Office" with it's Office.js API however, we are interested in learning whether or not our existing integrations can be replaced with this newer, lighter-weight, easier to deploy/maintain approach that would also enable us to integrate with other versions of Office such as Office Online, Office for Mac and Office for iPad.

    Our basic requirements are as follows:

    • The object model must support the programmatic loading of a document from a specific location in the file system or via streaming.
    • The object model must support the programmatic saving of the currently loaded document to a specific location in the file system or via streaming.
    • The programming model must support the ability to authenticate itself against a 3rd-party system secured with oAuth.

    I have just started to look over the Javascript API for Office but it is not yet clear to me whether or not it supports the loading/saving of a document.

    Thanks again for your insights.

    Regards,

    Lloyd



    Lloyd Charlier

    Monday, October 17, 2016 3:19 PM
  • Hi Lloyd,

    >> The programming model must support the ability to authenticate itself against a 3rd-party system secured with oAuth

    For this requirement, you could refer the link below:
    # OfficeDev/Word-Add-in-AngularJS-Client-OAuth
    https://github.com/OfficeDev/Word-Add-in-AngularJS-Client-OAuth

    For your first and second requirements, they are impossible with Office.js API. If these are new features you want to include in the future, I would suggest you submit a feedback in the link below:

    Reference: http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, October 18, 2016 5:19 AM