Outlook 2003 - Before send automation

P

paredondo

Hi,

I have a template form already created and in use. However the template has
several fields that must have have to be filled.

I cannot find a way to validate those fields, when I press the send button.
If for some reason, one or another field is not filled, the user must be
notified for the need to fill the specified fields.

So basicly, what I would need is some kind of automation implemented and
embbed in the template (since it is used by several users inside a corporate
net), in order to validate the template fields, before sending the e-mail.

Thanks,
Pedro Redondo
 
S

Sue Mosher [MVP-Outlook]

Simple validation can be done on the Properties dialog for each control. You'll find a Validation tab there. The alternative is to write VBScript code behind the form and publish it.

FYI, there is a newsgroup specifically for Outlook forms issues "down the hall" at microsoft.public.outlook.program_forms or, via web interface, at http://www.microsoft.com/office/com...spx?dg=microsoft.public.outlook.program_forms
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

paredondo

Hi,

Thanks Sue for your information. Sorry not to put the question in the
newsgroup area. I'll open a new thread there since I could not find one to
satisfy my need.

After that, can you please, tell me what kind of code should I use and where
(an example would be a must).

Thanks,
Pedro Redondo
 
S

Sue Mosher [MVP-Outlook]

For a text property:

Function Item_Send()
If Item.UserProperties("MyProperty") = "" Then
Item_Send = False
End If
End Function

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

paredondo

Hi Sue,

I've just used the code you mentioned, but modified... and put it into de
Script editor. After that I've published the form.

Function Item_Send()

If (Item.UserProperties("ME") = False) And (Item.UserProperties("MC") =
False) And (Item.UserProperties("MP") = False) Then
MsgBox "Tem de Preencher 1 dos campos"
End If

End Function

The field names are ME, MC and MP.

After published, I opened a new message based on the form, I've just
published and when I send the e-mail, a small error box appeared saying
("Object variable not set, Line no. 3")

What am I doing wrong ?

Regards,
Pedro Redondo
 
S

Sue Mosher [MVP-Outlook]

The error suggests that one of the three fields is not actually present on that item. You can see this for sure on the All Fields tab, under "user-defined fields in this item." Make sure all desired fields are present before you publish.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top