Outlook add-in-Cancel property page

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

Outlook add-in-Cancel property page
 
Chris Ducharme




Posts: 18
Joined: 2013-05-09
Is there a way to cancel the opening of the outlook add-in property page.

Currently i am trying to use the below code. It works, but is there a way to remove the message box that says "There are no add-in property pages to display."? Or is there a way for me to change the message in that box? Or is there a better way to do this?

Private Sub AdxOutlookAppEvents1_BeforeOptionPageAdd(sender As Object, e As AddinExpress.MSO.ADXOptionPageAddEventArgs) Handles AdxOutlookAppEvents1.BeforeOptionPageAdd
If Not CheckForConfigFile(False) Then
e.Cancel = True
End If
End Sub
Posted 27 Jun, 2017 11:35:56 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Chris,

This message is shown if there are no option pages to display. You can turn your add-in off to see the message "in the wild". Outlook provides no way to customize it.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Jun, 2017 05:12:08 Top
Chris Ducharme




Posts: 18
Joined: 2013-05-09
Then can I press the cancel button on the property page with code?

If I dispose of my property page it closes, but if the Outlook add-in options button is pressed again, the propertypage.load does not fire again. And the property page does not show.

I would like to be able to only open the property page if the configuration file is present, otherwise i show a message box with my custom message and cancel the property page.
Posted 28 Jun, 2017 10:43:55 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Chris,

There's no direct way. You should use UI Automation to find that button and invoke the default action. You can start with using an utility to study that window and how to invoke the default action. On my Windows 10, this utility is located in Program Files (x86)\Windows Kits\8.1\bin\{x64 or x32}\inspect.exe and in Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\{x64 or x32}\inspect.exe.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Jun, 2017 07:45:24 Top