none
Read Query string parameter from Word Online URL RRS feed

  • Question

  • Is there a way to read the full url on the address bar

    Office.context.document.url;

    function getFileUrl() {

    // Get the URL of the current file. Office.context.document.getFilePropertiesAsync(function (asyncResult) { var fileUrl = asyncResult.value.url; if (fileUrl == "") { showMessage("The file hasn't been saved yet. Save the file and try again"); } else { showMessage(fileUrl); } }); }

    The above the method read up 

    https://siteurl/ShareDocuments/testdate3.docx

    I need to pass a parameter on the url and read the parameters with javascript from url 

    like below

    https://siteurl/_layouts/15/Doc.aspx?sourcedoc=%7B25704021-22AE-43BC-AFE3-737C49D197B2%7D&file=testdate3.docx.docx&action=default&mobileredirect=true&section=Signatures

    I have also tried the code window.location.href  but it read the url of the addin task pane not the document

    • Edited by tapsb Thursday, January 17, 2019 1:48 PM
    Thursday, January 17, 2019 1:46 PM