MK_E_UNAVAILABLE in Marshal.GetActiveObject("Word.Application")
<p>0x800401E3 (MK_E_UNAVAILABLE) error occurs in my case when UAC (User Account Control) isn't set to the un-restrictive "Never Notify Me".</p>

<p><code>Microsoft.Office.Interop.Word.Application wd = 
(Microsoft.Office.Interop.Word.Application)
System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");</code></p>

<p>The error is thrown when the code is run after publishing and installing the project. While debugging in the editor instead, everything is fine.</p>

<p>Is this due to security settings or credentials ? How to write such code correctly pls ?</p>

<p>Win Word is open and a document is open too, of course, and this code has always worked fine with UAC set to "Never Notify Me".</p>
