Forum Discussion
Sleepy319
Mar 25, 2022Copper Contributor
What does the "sourcedoc" part of a SharePoint filepath represent?
Hi all, I've been working on opening sharepoint files with VBA (reference PowerPoint decks via a ribbon button). I'm using "Application.ActivePresentation.FollowHyperlink SharePointPath" whic...
sousounibajis
Apr 19, 2024Copper Contributor
Sleepy319 to achieve the behavior you're looking for, you need to refine the link provided to ensure that documents open in the SharePoint Online document viewer. This involves formatting the URLs in a way that directs users to the Office Online viewer integrated into SharePoint.
Construct the URL to follow this pattern:
https://<SharePoint-Site-URL>/<Document-Library>/Forms/AllItems.aspx?id=<Document-Library>/<File-Name>&parent=/<Document-Library>