How to get complete url of sharepoint document in add in

Deepak Dev 5 Reputation points
2023-09-15T11:44:20.99+00:00

Suppose this the link of my word document- https://-my.sharepoint.com/:w:/r/personal//_layouts/15/doc2.aspx?sourcedoc=%7B%7D&file=Document1.docx&action=...

while making a office word add-in and opening the word file in desktop or edge I want to retrieve complete url of word document.

On using Office.context.document.getFilePropertiesAsync or Office.context.document.url

I am able to get 'https://companyname-my.sharepoint.com/personal/username/Documents/Document 6.docx' but not the complete url.

Can anyone suggest a way using which I can get the complete url including email, sourcedocid .

Microsoft 365 and Office Development Other
Microsoft 365 and Office SharePoint For business Windows
Microsoft 365 and Office Word For business Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.