Show embedded form in new mail which is hidden by default

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

Show embedded form in new mail which is hidden by default
 
IT Support




Posts: 12
Joined: 2016-08-19
Hello,

I had posted about this issue earlier but din't seem to get it working. So here is my case again.

On clicking on a ribbon button (create by me) in the Outlook explorer, a new mail window opens with a form embedded in it.

However, I do not want the form to exist on clicking the 'New mail' in general but only on the click of the ribbon button allotted to it.

Previously you had answered,
" You can set ADXOlForm.Visible=false in the ADXOlForm.ADXBeforeFormShow event. "


On setting this my form is hidden now, bt I am unable to see the form in a new mail window on clicking on my ribbon button like before.

On the ribbon button click, my new mail window is getting displayed as per this code, but how to show my form in it?
OutlookApp.MailItem currMail = null;
currMail = OutlookApplication.CreateItem(OutlookApp.OlItemType.olMailItem) as OutlookApp.MailItem;
currMail.Display(false);

Could you help me with this, please?


Thank you
Posted 09 May, 2017 10:52:18 Top
Andrei Smolin


Add-in Express team


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

In the code of the ADXOlForm.ADXBeforeFormShow event, you need to determine whether the form should be shown or not; to prevent the form from being shown, you need to set ADXOlForm.Visible=false.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 May, 2017 03:39:23 Top
IT Support




Posts: 12
Joined: 2016-08-19
I have done as stated, but on clicking my ribbon button, my new mail window opens without the form (as its visibility was set to false) despite setting it to Visible = true again
Posted 10 May, 2017 04:13:12 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
I don't understand your "was set" and "again".

Here's a pseudocode:

%the ADXOlForm.ADXBeforeFormShow event handler%
if (some condition is true) then
   ADXOlForm.Visible = true
else 
   ADXOlForm.Visible = false
%the end of the event handler%


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 May, 2017 05:17:00 Top