My goal is to use a deep link to open a Word document with the Word desktop app on the client's machine.
"ms-word:ofv|u|file:///C:Users/John/Documents/example.docx"
Chrome recognizes this protocol and wants to open Word, but upon opening it I get an error saying the command is not recognized.
There is a doc for it, but it's not complete at all, typical of MSDN docs... https://learn.microsoft.com/en-us/office/client-developer/office-uri-schemes
I tried different variantions, like:
- file://\C:Users\John\Documents\example.docx
- file:\\\C:Users\John\Documents\example.docx
- C:Users/John/Documents/example.docx
- ...
I then stumbled upon this question: Details of Microsoft Office Url protocol?
So through this process, the executable used is protocolhandler.exe in the Office16 directory.
Next, I tried opening a docx file using the Word executable WINWORD.EXE, and although it opens word, it doesn't find the specified file.
"C:\Program Files\Microsoft Office\Office16\WINWORD.EXE" "C:/Users/John/Documents/example.docx"
I also tried with the protocol just in case, and other variants but to no avail.
Edit:
Using "C:\Users\John\Documents\example.docx"
(anti slash), I was able to open my docx file using the WINWORD.EXE.
So it really only is a syntax problem with the ms-word protocol