Is there an Application URL Protocol for MS Word?
Asked Answered
P

3

16

I'm working on a javascript front end site to run in the browser [Chrome], and I'd like to launch Word on the clients PC with their selected macros that have already been setup in Word for them on their pc.

My questions is does Office [and Word] create an Application URL Protocol [MSDN how to article] for itself when installing it?

For example, iTunes does this, with the url 'itmss://itunes.apple.com/us/app/123213213?mt=8' which, if the user has installed iTunes, will prompt them to open it.

Is there a Word equivalent protocol to itmss? Can I pass the macro names to it as parameters?

If there not an equivalent protocol, does anyone know how I might achieve something similar?

Perfervid answered 10/4, 2014 at 11:40 Comment(4)
I don't think such a protocol exists.Reagent
There is no such protocol for Word, but you can create one on Windows-never done it myself, but the necessary information is at msdn.microsoft.com/en-us/library/aa767914 .Sales
crawling through OneDrive htmls, I've come across this "protocol": "ms-word:ofe|u|<url>", it launches an instance of microsoft word and opens the document pointed by <url>, however, I couldn't find any documentation about it yet and couldn't even make it work by myselfNoneffective
They have finally managed to get some documentation out and available from the MSDN site: msdn.microsoft.com/en-us/library/office/dn906146.aspxBluebeard
P
30

You could try to write your link as follows:

ms-word:ofe|u|http://example.com/myTestDocument.docx

Note that this will most likely require you to have a WEBDAV server running, that is capable of interpreting such requests.

The details about what is the meaning of ofe or u can be found in here

This protocol is available starting Microsoft Office 2010 Service Pack 2 (yes, there are service packs for office also).

President answered 20/8, 2014 at 9:4 Comment(7)
You can see this in action on OneDrive. Add a .docx document and choose to open it in Word.Albin
ofe means open-for-edit-cmd, see msdn.microsoft.com/en-us/library/office/…Pumpkinseed
I have one file on onedrive, but I can't figure out how to build it's URL. The API returns a file object with properties like upload_location, source and link, which are all different URLs. Any ideas?Tomtom
Is there a way to autologin with provided username/password?Jelly
@Jelly if I recall correctly, you can use the normal username:password@host format for basic authenticationPresident
I can use it outside the msoffice uri scheme, but once I use it it still asks for username-password. Seems it doesnt use browser cookies and tries to reauthenticate by itself.Jelly
This works well with office.js on Windows but I can't get it to work on Mac. Any ideas why?Broncobuster
P
6

Office 2010 SP2 and above install URI Schemes which you can use from your website. Microsoft has documentation for these available here: https://msdn.microsoft.com/en-us/library/office/dn906146.aspx

There is a protocol for each of the office products. The MS Word protocol is ms-word:<command-name>"|"<command-argument-descriptor>"|"<command-argument>"

You probably want the "open for edit" command which looks like this: ms-word:ofe|u|<document-uri>

Paugh answered 18/4, 2015 at 2:17 Comment(0)
W
0

install LibreOffice

vnd.libreoffice.command:ofe|u|file:our doc, docx, xls, xlsx ....

window.location.href = "vnd.libreoffice.command:ofe|u|file:
Winged answered 6/2, 2024 at 9:50 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Diehard

© 2022 - 2025 — McMap. All rights reserved.