Differences in HTMLBody property of reply object

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

Differences in HTMLBody property of reply object
 
Maja


Guest


Hey AddInExpress team,

I've noticed while playing around with replies in Outlook add-in that there is difference in the HTMLBody property of the MailItem reply object when it is retrieved through clicking on Reply button on Outlook Ribbon versus when created with MailItem.Reply() method.
Also, retrieving an inspector with reply.GetInspector changes the HTMLBody property of the reply object.

Do you maybe know why?

Thanks
Posted 07 May, 2021 09:43:54 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Maja,

In the first case, to avoid this difference, you should create an email by "clicking" the corresponding Ribbon button programmatically. This performs all the steps that Outlook performs behind the scenes. This applies to Reply, Forward, ReplyAll as well as to creating a new email.

To execute the Ribbon command behind a built-in Ribbon button, you get the CommandBars object and invoke CommandBars.ExecuteMso("{the IdMso of the Ribbon command here}". In the Outlook object model, only Inspector and Explorer objects have the CommandBars property. Use Inspector.CommandBars or Explorer.CommandBars depending on the window in which the corresponding Ribbon button is shown. Say, you can click Reply in Explorer (=the Ribbon command IdMso="Reply" is available in the Explorer window). That means, if the original email is selected, you can get Explorer.CommandBars and the call CommandBars.ExecuteMso("Reply"). If the original email is opened in an Inspector window, you get Inspector.CommandBars and the call CommandBars.ExecuteMso("Reply").

Maja writes:
Also, retrieving an inspector with reply.GetInspector changes the HTMLBody property of the reply object.


I'm not aware of this issue. In what scenario do you see it?


Andrei Smolin
Add-in Express Team Leader
Posted 07 May, 2021 11:38:49 Top