Is there an Application URL Protocol for MS Word?

2020-02-28 01:59发布

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?

2条回答
可以哭但决不认输i
2楼-- · 2020-02-28 02:40

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>

查看更多
看我几分像从前
3楼-- · 2020-02-28 02:50

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).

查看更多
登录 后发表回答