locked
VSTO-Sharepoint new Word document: detect server path? RRS feed

  • Question

  • Hi,

    Starting a new Word document from a Sharepoint portal triggers a Word Addin (VSTO) application.
    Within this application I am interested in the server path from which the new document has been started.
    I noticed that after saving the document to the portal, this informatrion is available within the Fullname or Path property of the document, but before saving I can not find any handle to detect this information.

    Does anyone have an idea how to identify the server path from which the new document is triggered (before saving it)?

    Regards,

    Maurice Martin

    Wednesday, February 1, 2012 8:08 AM

Answers

  • I've never done this so I'm only guessing, but I wouldn't expect the server path to be available on the document because in theory it could be saved to anywhere. You might be able to get it though from the template that the document was created from. I don't remember a huge amount about the Word Object Model, but I think the document will have a template property, this might then have the server path that you need.
    • Marked as answer by Pengyu Zhao Friday, February 10, 2012 2:10 AM
    Wednesday, February 1, 2012 12:34 PM
  • I doubt it'll have a server path as it'll be stored within the content databases (against a content type), which are likely to be different file servers from the SharePoint front ends or the client side that'll be generating the document.

    As Mullers says though, you may have some luck with the Word Object Model but this is an area that I'm not very well versed in myself.


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    • Marked as answer by Pengyu Zhao Friday, February 10, 2012 2:10 AM
    Wednesday, February 1, 2012 1:06 PM
    Answerer

All replies

  • I've never done this so I'm only guessing, but I wouldn't expect the server path to be available on the document because in theory it could be saved to anywhere. You might be able to get it though from the template that the document was created from. I don't remember a huge amount about the Word Object Model, but I think the document will have a template property, this might then have the server path that you need.
    • Marked as answer by Pengyu Zhao Friday, February 10, 2012 2:10 AM
    Wednesday, February 1, 2012 12:34 PM
  • I doubt it'll have a server path as it'll be stored within the content databases (against a content type), which are likely to be different file servers from the SharePoint front ends or the client side that'll be generating the document.

    As Mullers says though, you may have some luck with the Word Object Model but this is an area that I'm not very well versed in myself.


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    • Marked as answer by Pengyu Zhao Friday, February 10, 2012 2:10 AM
    Wednesday, February 1, 2012 1:06 PM
    Answerer