If the recipient doesn't resolve, you should be able to call
objRecip.Delete. If you want to clear all recipients (which would seem to
make more work for the user), set the value of the To and CC properties to
"".
And that's VBScript code that an Outlook form uses, not JScript.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"Delnang" wrote in message
...
The code reads as follows:
Function Item_Send()
Const olCc = 2
Set objRecip = Item.Recipients.Add
(Item.UserProperties("ManagerEmployeeNumber2"))
If objRecip.Resolve Then
objRecip.Type = olcc
Else
MsgBox "Manager Employee Number is either not valid or blank. Please
enter
a valid employee number."
Item_Send = False
End If
End Function
The error message would be what's in the MsgBox line of code.
Thanks,
Angie
"Sue Mosher [MVP]" wrote:
What jscript are you talking about? What error message?
"Delnang" wrote in message
...
I have a text box for employee number. This field is used to address
the
CC
field. If the employee number is typed incorrectly and therefore
cannot
be
resolved and error message show. What I'd like to do is after the
message
is
acknowledged by the user the employee number field, To, and CC fields
are
cleared. Is there code I can add to the jscript to clear those fields?