Forum Discussion
DanielNiccoli
Dec 24, 2018Iron Contributor
Possible to open docx files in Word Online when double-clicking them in a synced desktop library?
My client is having difficulties adjusting to Office Online. We sync his SharePoint Online library using OneDrive for Business, so he has it easier to upload files they create outside of Office 365. ...
jirikovo
Apr 14, 2023Brass Contributor
Hey guys, have you found any solution for this?
- Brock315Aug 12, 2023Copper Contributor
I have a solution I rolled in Chatgpt. It would probably take someone that is familiar with C# and Visual Studio to run. Maybe you can find one of your employees and get them to run it. I was going to try to charge you guys but it only took me a couple of minutes. Cheers and I hope this helps.
using Microsoft.Win32; using System; using System.Diagnostics; using Microsoft.Win32; class Program { static void Main(string[] args) { RegisterFileAssociation(".docx", "WordOnlineRegEditor", "Open .docx files with YourAppName"); } static void RegisterFileAssociation(string extension, string appName, string description) { using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(extension)) { key.SetValue("", appName); } using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(appName)) { key.SetValue("", description); using (RegistryKey commandKey = key.CreateSubKey("shell\\open\\command")) { commandKey.SetValue("", "C:\WordOnlineRegEditor.exe \"%1\""); } } } static void Main(string[] args) { if (args.Length > 0) { OpenInWordOnline(args[0]); } } static void OpenInWordOnline(string filePath) { string wordOnlineUrl = "https://word.office365.com/"; string fileUrl = Uri.EscapeDataString(filePath); string fullUrl = $"{wordOnlineUrl}/?wopisrc=OneDrive&wdFirstNav=1&wdAllowInteractivity=False&FileUrl={fileUrl}"; Process.Start(fullUrl); } }