Help with simple Send Event

T

Theresa

Ok, so I am doing some basic form validation using VBScripts functions...if
they dont resolve I set the send function to false...can anyone tell me why
it still sends??
Function Item_Send()

If not isNumeric(item.userproperties("cost center")) then

Item_Send = False

msgbox "Cost Center must be numeric"

End If

End Function
 
C

carl lorentson

I believe you need something like the code below. Note the use of the
Cancel parameter. (Source: Ms Outlook VB Ref | Events | Send Event)

Function Item_Send(Cancel)

If not isNumeric(item.userproperties("cost center")) then

Cancel = True 'Item_Send = False

msgbox "Cost Center must be numeric"

End If

End Function

Hope that works,
Carl Lorentson
 
S

Sue Mosher [MVP]

The form-level Item_Send event does not have a cancel parameter. Item_Send = False is the correct way to cancel the send. I would start my troubleshooting by adding a MsgBox statement to display the value of item.userproperties("cost center")

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
 

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