Host Office apps in a WPF Application

Viewed 49

I am currently working on a project that requires a text editor. All of the computers that will be running this app will have the whole office suite installed, more specifically Office365. I started building my own text editor but it would take a lot of time to implement some QOL Microsoft Word has so I started looking up ways to somehow host Microsoft Word inside a WPF Window or at least make it look like it is docked. So far I have found stuff from 10+ years ago mentioning OLE and what not but I figured it is probably way outdated.

Can anyone here please point me in the right direction ?

1 Answers

You can't host Office365 product in your app, Microsoft does not offer such a service.

Since you want a text editor, you can look for off-the-shilf products like avalonEdit:TextEditor, download it via NuGet and use it in your view just like this..

<avalonEdit:TextEditor
    xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
    Height="400"
    FontFamily="Consolas"
    FontSize="12pt" />

Another lovely open source WPF-based text editor is Notepads, but there is no ready-to-use usercontrol similar to avalonEdit:TextEditor. You have to include it in your solution as a class library then embed it in your windows application (can't predict how much effor/time can it take).

Related