Outlook VSTO add-in scaling issues with WebBrowser

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

Outlook VSTO add-in scaling issues with WebBrowser
 
Robert Mills




Posts: 19
Joined: 2018-07-30
Hi,

We're working on add-in that will emulate some of the basic behavior available with Microsoft's new html based add-in model. An issue we are running into, is the WebBrowser on a 4K display doesn't respect scaling as set by the host OS. In terms of a repro, I can share one but essentially just need to create a COM add-in, add an ADXOlForm and add a WebBrowser as the only form element (you can point to https://www.google.com).

I'm leery that it's a problem with being hosted as part of an ADXOlForm, but wanted to post here to see if anyone has encountered such an issue before.

Thanks.
Posted 30 Jul, 2018 13:30:47 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Robert,

Note that Office 2016 changes a lot. Just recently Office Insider builds started supporting the recent feature of Windows 10: support of multiple monitors with different DPIs. The main problem is: Add-in Express Regions for VSTO doesn't support that feature. Once the Region starts providing support for this feature (the ETA isn't set yet), you would need to 1) use the new Regions version, and 2) modify your code to comply with the way Office works.

As to what you see, please check if the following project works for you: http://temp.add-in-express.com/support/OutlookAddIn2-ForRobertMills.zip.


Andrei Smolin
Add-in Express Team Leader
Posted 31 Jul, 2018 03:50:07 Top
Robert Mills




Posts: 19
Joined: 2018-07-30
Hi Andrei,

Thanks so much for the response. I tried to run the project, but it appears there is a missing reference (AddinExpress.Outlook.Regions) - is our current subscription (https://www.add-in-express.com/add-in-net/index.php) insufficient?

Thanks,
Robert
Posted 31 Jul, 2018 09:51:06 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Robert,

Your original post created an impression that you develop a VSTO add-in using our Add-in Express Regions for Outlook and VSTO. That's why we sent you a VSTO project referencing an assembly that that tool provides.

Here's an Add-in Express for Office and .NET demo project that we use without an issue in our environment: http://temp.add-in-express.com/support/MyAddin46-ForRobertMills.zip. The something-isnot-supported stuff above doesn't relate to Add-in Express for Office and .NET if you use the latest build.


Andrei Smolin
Add-in Express Team Leader
Posted 31 Jul, 2018 10:22:50 Top
Robert Mills




Posts: 19
Joined: 2018-07-30
Posted 01 Aug, 2018 21:27:36 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Robert,

Although we can't see the images, we have succeeded in reproducing this issue. It is always reproducible if Outlook starts on a monitor having DPI different from the main monitor's DPI. In our case - we have a 2K monitor, DPI 100% and a 4K monitor (main), DPI=200% - we see that the web page is significantly zoomed in. We suggest that you use the ADXOlForm.ADXDPIChanged event to zoom the web page's content as required. To implement this, see https://social.msdn.microsoft.com/Forums/en-US/151dcd48-4f09-4701-aa10-edc34617e7f2/how-to-zoom-a-web-browser-programatically-in-c?forum=csharpgeneral and use the dpiFactor parameter that the event handler provides.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Aug, 2018 05:07:07 Top
Robert Mills




Posts: 19
Joined: 2018-07-30
Hi Andrei,

The WebBrowser zoom support turned out to be the solution also with doing some calculation on zoom factor based on current DPI.

Thanks for your help.
Posted 07 Aug, 2018 08:14:47 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Great!


Andrei Smolin
Add-in Express Team Leader
Posted 07 Aug, 2018 08:39:45 Top