OutlookApp.ActiveInspector.WordEditor throws System.Runtime.InteropServices.COMException (0x80004005)

Add-in Express™ Support Service
That's what is more important than anything else

OutlookApp.ActiveInspector.WordEditor throws System.Runtime.InteropServices.COMException (0x80004005)
 
Subscribe
Sergey Chizh




Posts: 76
Joined: 2012-10-23
Hi.

PRECONDITIONS:
- Microsoft® Outlook® til Microsoft 365 MSO (Version 2504 Build 16.0.18730.20220) 64-bit
- Windows 11 Version 24H2 (x64)

We have the functionality, which allows to paste text blocks into email body. For this purpose we use the code, which starts with the following code:

Dim MailEditor As Word.Document = AddinModule.OutlookApp.ActiveInspector.WordEditor

Dim sel As Word.Selection = Nothing
If AddinModule.OutlookApp IsNot Nothing Then
sel = MailEditor.Application.Selection
End If

And the exception occurs right after first line. It worked perfectly until Office has been updated to Version 2504.
Could you please assist resolving this issue? Thank you!
Posted 27 Jun, 2025 10:55:06 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
Hello Sergey,

I start Outlook Version 2025 (Build 18827.20176 Click-to-Run), press Alt+F11 to open the VB Editor, double-click the ThisOutlookSession node, and paste the following VBA macro to the code pane:

Sub dfdfghh()
Dim wdoc As Word.Document
Set wdoc = Application.ActiveInspector().WordEditor
Stop
End Sub


Then I open an inspector, switch to the VB editor, put the text cursor on any line of the macro, and press F5 (menu Run | Run Sub/UserForm). I've tried both composing and reading inspectors; in both cases the macro stops at the Stop statement. That is, the macro doesn't break.

The test above requires appropriate permissions.

Also, you could check if the issue originates from your code or from the environment. Create a simple add-in with a Ribbon button shown in Inspector; in the Click event invoke OutlookApp.ActiveInspector.WordEditor and see if it produces the exception.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Jun, 2025 15:19:06 Top