MS Outlook 2010 custom form - validation or formula to request user to check a checkbox

Status
Not open for further replies.

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
Hi,

I have a checkbox on my custom outlook form which needs to be checked by the user before it is sent. For some reason the "A value is required for this field" is greyed out. Could somebody please help me with a formula or solution that would force the user to check the box and not leave it blank. My checkbox is associated with a Yes/No field type, format: Yes/No and property to use: Value. I've tried all different options, i.e. On/Off, True/False, TripleState, etc. but to no avail.

Any assistance would be greatly appreciated.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Do you have script behind the form? If so, you use use the before close function to check for a value.

This is apparently a limitation of yes/no fields - not sure why though (possibly because it's either check or not). If you can use a text field, that will work.
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
Good afternoon Diane,

Thank you very much for responding. In the end I found some code and modified it a bit.

Code:
Code:
Function Item_Send()
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("Message")
Set ck = objPage.Controls("CheckBox1")
If ck.Value = False Then
Msgbox ("Please confirm that this mail request is releated to work activities")
Item_Send = False
End If
'MsgBox "Item being sent without a winmail.dat file attached"
'Item.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", False
End Function
Don't ask me what it all means but it seems to work!:(

I don't like the fact that custom forms do not display in the preview/reading pane. Even with the two lines of code above it still didn't work.

Regards,

Potty Ash
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I don't like the fact that custom forms do not display in the preview/reading pane.
In older versions with limited capabilities in the reading pane, it was security issues and the inability to show controls in the reading pane. With the improvements in the pane's capabilities, they could probably show controls now, but it is a security risk (and they are tightening things up lately in regards to controls and code in forms.)
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Don't ask me what it all means but it seems to work!
this part is saying, if the box on the message page is not checked, don't send.
Set objPage = objInsp.ModifiedFormPages("Message")
Set ck = objPage.Controls("CheckBox1")
If ck.Value = False Then
Item_Send = False
End If

This (if it wasn't commented out) is setting the TNEF property to false, "don't use TNEF"( aka RTF). This would convert the message to plain text. Generally speaking, you need TNEF for meeting requests, task requests/updates, and voting. It's optional in normal email and shouldn't be used outside of exchange.
Code:
Item.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", False
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
Thanks Diane for the information, it's good to know.

I have noticed that my custom form's ribbon has replaced the standard tab title 'Message' with the name I gave my form which is 'Express Mail Request'. The tab is identical to the standard 'Message' tab except my ribbon 'Express Mail Request' contains a group, namely 'Show' which has two commands 'Message' and 'P.2'. Is this normal or have I completely gone wrong somewhere? The message class states IPM.Note.Express Mail Request.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
contains a group, namely 'Show' which has two commands 'Message' and 'P.2'.
This means that you put something on the formerly hidden tab named P.2. You can rename it from the Page menu in the designer.

It's hidden in this screenshot, but putting any control on it will automatically unhide it - and the () are removed from the name. If you delete whatever you added to it, it remains visible but can be hidden from the Page menu.

form-page.png
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
So I don't really need any fields, controls, etc. on P.2? Currently, the 'Message' and 'P.2' pages are identical.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
No, you don't have to use it or show it, unless you need it for some reason, in which case, you can rename it.
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
Thanks for that Diane. Also, as my 'Compose' and 'Read' pages are the same I'm assuming I don't need 'Separate Read Layout'?

If I may ask, is it possible to launch a custom form externally from Outlook itself. The plan now is to get our network administrator to publish the form to the exchange server (the Organizational Forms Library I believe) where I hope it will be available to the users. However, access to the form must be from our extranet through a hyperlink and not Outlook.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
my 'Compose' and 'Read' pages are the same I'm assuming I don't need 'Separate Read Layout'?
Yeah, you don't need a separate read layout if they are identical.

However, access to the form must be from our extranet through a hyperlink and not Outlook.
A specially crafted hyperlink, yes, but Outlook needs to be installed to use it.
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
I'm just waiting for our network administrator to publish my form to the Organizational Forms Library. Out of interest, is this something he will do from my machine, i.e. logon as an administrator and publish or do I need to send him an .oft or .msg file?

In the meantime I've been testing the form from the Personal Forms Library by sending it to myself and also a few users ('Send form definition with item' checked). To my surprise when 'Replying' and 'Replying to All' we notice that the form and its contents are not included. The 'Forward' function is okay.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You'll need to provide it to him as a fdm file or an oft, as he'll need to use an account that has permission to publish to the Org library.
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
Hi Diane, thanks once again for the information. I've been reading through some of the forum posts to get a better understanding of custom forms in general.

Would you happen to know why there are no Actions defined/listed on my form's Actions page, even though the form seems to work okay, albeit with the usual quirks and limitations of a custom form. Have I done something drastically wrong because I've just experimented by creating a new form based on a Message item and I can see the following listed Actions: 'Reply', 'Reply to All', 'Forward' and 'Reply to Folder' all enabled.

This leads me to my final question (a possible show stopper). Is it true to say that a custom form (in a mail/message) and its field data will not appear in a reply by the recipient? As I mentioned in my post yesterday, when I want to forward the message it's included.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Actions: 'Reply', 'Reply to All', 'Forward' and 'Reply to Folder' all enabled.
these should be listed as long as you didn't delete them.

props.png


Is it true to say that a custom form (in a mail/message) and its field data will not appear in a reply by the recipient?
possibly. it should work when everyone is on the same exchange and the form is published to the org library, but may not work with other addresses unless you include the forms definition (and that is no guarantee).
 

Potty Ash

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2013
I'm not sure what happened but I must have deleted them somehow. Can I recreate the Actions or is it best to start a new form and copy all the fields across?

I'll wait and see what happens regarding the 'Reply' issue when the form is published to the Organizational Forms Library. Cheers Diane.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
If the form is not too complicated to recreate, i would recreate it but you can add the fields back if it is complicated.
 
Status
Not open for further replies.
Top