For a script that will return a hook://file/
or a MS specific URL see:
Paste that in Hook’s Get Address script for Microsoft Word. If the file is in OneDrive, OneDrive sync is on, and you invoke Hook in a MS Office app, you should get a MS specific URL.
Of course MS specific URLs are not useful if you move the file out of OneDrive (say into a different Finder folder ).
If you’d like to try it and let us know whether it works for you that would be grand.
Updated 2021-05-29 to reference Using Hook in OneDrive – Hook rather than including the script here.