Outlook WebBrowser Component does not display some email contents properly

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

Outlook WebBrowser Component does not display some email contents properly
 
TheNewCOMAddin Dev


Guest


Background

We have a Outlook ADX Addin with code to replace the Reading Pane and show our ADXForm which contains a webbrowser component that inturn displays the email (MailItem.HTMLBody as is) after injecting some additional message from our end.

Problem:

All works well till FHD resolution. However when our users use a UHD Resolution laptop or desktop (single display not multiple displays), we see the following issue:
Some emails content appears too small while other emails appear alright.

Analysis so far
- Looking specifically inside the source of these emails that appear smaller, we found that these emails are coded specifically to show the font-sizes in pixels (via html / stylesheet) e.g "font-size: 20px" while those that display it fine are with font-size in points (font-size: 12pts), we think the cause of this is probably that webbrowser component is not converting (or is not supposed to convert) pixels to points and display it. We could be wrong but this is what we are observing so far.

Question
- How do we solve this?

Thanks,
-Jatin
Posted 27 Mar, 2020 09:18:19 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello Jatin,

Our guys suggest that you try to use the information they provide at https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)?redirectedfrom=MSDN to create/modify the Outlook-related value under HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Mar, 2020 02:58:53 Top
TheNewCOMAddin Dev


Guest


Hi Andrei,

Thanks for the response and link.
I tried the following but it still did not have the needed output.

The blog points out to doing this :
- Add / Modify the entry : HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION and changed the Decimal Value of "OUTLOOK.EXE" : 11001 : So it would take the latest edge version. Note we are not sure if it needs the Addin DLL path there.
- I tried above and navigated the webbrowser component to http://www.whatismybrowser.com :
The same reported it as Outlook 16 Windows 10 and not edge. Post this changes the original issue we had could still be seen (pixels vs pts).
- This probably mean that its not taking the edge browser that we want it to take.
We ideally want to render using the edge engine and not go for any third party library if possible as it would increase the complexity and also size of the MSI.

Do let us know if we are missing out on anything.

However, While checking for other solutions we came across this WebView (https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/)
+ Does a ADXForm Support addition of a WebView ?
+ We also see there are other browser replacement like CEF (https://cefsharp.github.io/) / DotNetBrowser (https://www.teamdev.com/dotnetbrowser) / WebKitX (https://www.webkitx.com/) : Is ADX Addin compatible with these?

Thanks,
- Jatin
Posted 31 Mar, 2020 11:41:38 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello Jatin,

Our guys look into this. Note that we may have no answer to [some of] your questions as they seemingly do not relate to the Outlook object model.


Andrei Smolin
Add-in Express Team Leader
Posted 01 Apr, 2020 03:38:32 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello Jatin,

TheNewCOMAddin Dev writes:
I tried above and navigated the webbrowser component


First off, use https://www.whatsmybrowser.org/ to detect the browser used. Note that although the browser emulation can help in some cases, we also suggest that you look in your HTML, styles, logic, etc. This is because there are other Outlook versions in which the browser emulation may not work. Pay attention: you can use the ADXDPIChanged event that the form provides to zoom the HTML content.

TheNewCOMAddin Dev writes:
Does a ADXForm Support addition of a WebView


This isn't a question of Add-in Express supporting this or that web view component. This is a question of whether such a component supports being run in the process of Outlook. As you know, an add-in is a DLL loaded in the host application's process while all such components target (in the first place) running in the process of a standalone application.

Just a warning. Creating such a web view component is difficult and vendors make their task easier by creating a browser component (typically an ActiveX component) that works in a browser and providing a wrapper that you use as a web view component. If this approach is used, this means you'll need to have that browser component installed and registered.


Andrei Smolin
Add-in Express Team Leader
Posted 01 Apr, 2020 05:14:28 Top