Issue with using a webbrowser control during print event with latest Office 365 release (1803)

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

Issue with using a webbrowser control during print event with latest Office 365 release (1803)
 
Alexander de Man




Posts: 47
Joined: 2007-05-03
Hello,

We have a strange situation with our add-in on some computers with the latest Office 365 release version 1803 (Build 9126.2116 Click-to-Run). I've created a test add-in to isolate the problem.

This add-in handles both the FilePrintQuick ribbon command and DocumentBeforePrint event. Both call a method that shows a WinForms form with a webbrowser control. The form that gets triggered first (by the FilePrintQuick command) works fine, but on the second one the webbrowser doesn't seem to get initialized properly (it stays gray) and locks the form (close button doesn't respond anymore).

Do you have any whats happening? If you want, I can send you the test add-in and/or organize a TeamViewer session if you want.

FYI: I'm using the special high dpi build of Add-in Express.

Thanks
Posted 05 Apr, 2018 03:58:28 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Alexander,

You can try one of these:
- show the form after a delay created e.g. using the SendMessage/OnSendMessage machinery that we describe in section Wait a Little at https://www.add-in-express.com/docs/net-office-tips.php#wait-a-little
- let the form show right in the event but set the URL after such a delay


Andrei Smolin
Add-in Express Team Leader
Posted 05 Apr, 2018 06:59:20 Top
Alexander de Man




Posts: 47
Joined: 2007-05-03
Hello Andrei,

Thanks for your reply. I've tested it with a button that loads the url later and that seems to work. I'm going to try your solution in our real add-in and let you know if that solves it.

Regards
Posted 06 Apr, 2018 05:11:40 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Thank you. I'm interested to know about your result.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Apr, 2018 05:19:55 Top
Alexander de Man




Posts: 47
Joined: 2007-05-03
Hello,

I moved the webbrowser navigate to the Shown event, but also had to move several design time properties of the webbrowser control to this event to fix the issue.

Regards
Posted 06 Apr, 2018 09:11:35 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Thank you!


Andrei Smolin
Add-in Express Team Leader
Posted 09 Apr, 2018 03:14:27 Top