lundi 22 décembre 2014

Office Web Apps URL - UniqueId or ServerRelativePath



I use the following method to construct the URL to edit a document in Office Web Apps:



public string GetFullOwaUrl(Guid uniqueId)
{
return string.Format("{0}/_layouts/15/WopiFrame.aspx?sourcedoc={{{1}}}&action=edit", WebFullUrl, uniqueId);
}


This works for me using Office 365 (i.e. SharePoint online). But does not work when using on-premises SharePoint 2013 Foundation. If I use the server relative document path in place of the UniqueID for the sourcedoc parameter then it works OK with my on-premises installation:



public string GetFullOwaUrl(string serverRelativePath)
{
return string.Format("{0}/_layouts/15/WopiFrame.aspx?sourcedoc={1}&action=edit", WebFullUrl, serverRelativePath);
}


I would really prefer to use the UniqueId in both circumstances as (I presume) it avoids any issues with the URL changing if the file is renamed. Can anyone shed any light on why the UniqueId does not work with my on-premises installation?








0 commentaires:

Enregistrer un commentaire