14

Microsoft Office Documents register custom url protocol on the client computer.

This is especially used by SharePoint. For example, if I open an excel file, I see the call to this url :

ms-excel:ofv|u|https://mycorp.sharepoint.com/Documents/somefile.xlsx

Is there any available documentation of this feature?

What are the format and options of these urls?

Steve B
  • 36,818
  • 21
  • 101
  • 174

3 Answers3

24

There is limited documentation available here. These protocol handlers appear to only support http and https URI.

To summarize, Microsoft office registers the following protocol handlers:

  • ms-word:
  • ms-powerpoint:
  • ms-excel:
  • ms-visio:
  • ms-access:
  • ms-project:
  • ms-publisher:
  • ms-spd:
  • ms-infopath:

To view a document:
ms-excel:ofv|u|http://contoso/Q4/budget.xls

To edit a document:
ms-powerpoint:ofe|u|http://www.fourthcoffee.com/AllHandsDeck.ppt

To Create a New Document from a template:
ms-word:nft|u|http://cohowinery/templates/elegance.pot|s|http://cohowinery/presentations

There is currently no protocol handler registered on Microsoft Windows to launch Power BI.
Support is available on mobile platforms (including Windows Mobile) via the mspbi protocol handler. The following is a summary of the official documentation which is available here.

Open the Power BI mobile app:
mspbi://app/

Open to a specific dashboard:
mspbi://app/OpenDashboard?DashboardObjectId=<36-character-dashboard-id>

Open to a specific tile in focus:
mspbi://app/OpenTile?DashboardObjectId=<36-character-dashboard-id>&TileObjectId=<36-character-tile-id>

Open to a specific report:
mspbi://app/OpenReport?ReportObjectId=<36-character-report-id>

Open a specific report page:
mspbi://app/OpenReport?ReportObjectId=<36-character-report-id>&reportPage=ReportSection<number>

Open in full-screen mode (for Windows Mobile devices only):
mspbi://app/OpenReport?ReportObjectId=500217de-50f0-4af1-b345-b81027224033&openFullScreen=true

codechurn
  • 3,870
  • 4
  • 45
  • 65
  • 1
    So those protocols does not support file:// in the URI? – Rudolf Dvoracek Jun 27 '18 at 16:35
  • 1
    @RudolfDvoracek it does not appear so at this time. There is no documentation on the topic and hacking at it, I could not make file:// work – codechurn Jun 27 '18 at 18:57
  • 1
    Is there a way to make MS word open two documents with this protocol? – Sathish Mar 04 '19 at 07:26
  • 1
    @Sathish You would have to fire off two separate requests – codechurn Mar 06 '19 at 15:48
  • 2
    Really frustrating that this doesn't support `file://` – Kieran Quinn Aug 26 '19 at 10:48
  • 6
    It does support ˋms-word:ofe|u|C:/path/to/file.docxˋ, though. Forward slash, not backslash. – Andreas Linnert Apr 08 '20 at 11:12
  • 2
    @AndreasLinnert your suggestion works, but only if there is no spaces in path. Is there a workaround for that also? I tried '+', '%20, but nothing works. – Silko Jul 15 '20 at 13:41
  • Is there a scheme for Power BI? I've tried searching but can't find anything except possibly "mspbi" but it seems strange that they wouldn't follow the "ms-" convention. – lane Sep 01 '20 at 10:31
  • 1
    @lane the `msbpi` protocol handler only appears to apply to mobile devices. On my Windows 10 machine, with both Power BI Desktop and the Windows Store Version of Power BI this handler is not registered. This seems to be inline with the [official documentation](https://learn.microsoft.com/en-us/power-bi/consumer/mobile/mobile-apps-deep-link-specific-location). – codechurn Dec 29 '20 at 02:10
  • @Silko, did you ever found a workaround for this? – Roel Jansen May 13 '22 at 07:02
4

Since i do not have the reputation to comment, here is a solution for local files, which seems to work for me (Microsoft 365 MSO (16.0.13530.20490) 64-bit):

"C:\Program Files\Microsoft Office\root\Office16\protocolhandler.exe" "ms-powerpoint:ofe|u|file:///C:/path/to/file with spaces.pptx"

Important to note are the forward slashes. Also if you use the wrong program, i.e. use ms-powerpoint for .xlsx files, this will fail. protocolhandler.exe is located in the Office root directory, which might be in another location on your system (it's the directory where WINWORD.EXE, POWERPNT.EXE etc. are located)

hslin
  • 51
  • 5
0

If you want to open local file, maybe try:

ms-excel:file:/Users/river/Desktop/2.xlsx

ms-word:file:/Users/river/Desktop/2.doc

...

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
River
  • 1