A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Code to clear certain fields in Outlook Form



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 20th 10, 08:05 PM posted to microsoft.public.outlook.program_forms
Delnang
external usenet poster
 
Posts: 23
Default Code to clear certain fields in Outlook Form

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?

Angie
Ads
  #2  
Old January 20th 10, 09:18 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Code to clear certain fields in Outlook Form

What jscript are you talking about? What error message?
--
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
...
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?

Angie



  #3  
Old January 20th 10, 11:43 PM posted to microsoft.public.outlook.program_forms
Delnang
external usenet poster
 
Posts: 23
Default Code to clear certain fields in Outlook Form

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?
--
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
...
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?

Angie



.

  #4  
Old January 21st 10, 12:03 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Code to clear certain fields in Outlook Form

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?



  #5  
Old January 21st 10, 09:00 PM posted to microsoft.public.outlook.program_forms
Delnang
external usenet poster
 
Posts: 23
Default Code to clear certain fields in Outlook Form

Sue - Thank you!!! I'll remember that...VBScript not JScript. I think I
have one last question. The VBScript I have now is 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 not valid, blank or contains the ""e"".
Please enter a valid employee number."
Item_Send = False
objRecip.Delete
Item.UserProperties("EmployeeNumber")= ""
End If
End Function

What is happening now, is that I can enter a valid Employee Number, but all
other fields (except the Memo field) is locked (won't let me backspace or
highlight/edit). If I were to click in the Memo field then one of the other
fields, I can edit their content. Is there a way the fields can be editible
without having to click the Memo field first?
Angie
"Sue Mosher [MVP]" wrote:

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?



.

  #6  
Old January 21st 10, 09:12 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Code to clear certain fields in Outlook Form

Exactly when are you seeing this problem?
--
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
...
Sue - Thank you!!! I'll remember that...VBScript not JScript. I think I
have one last question. The VBScript I have now is 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 not valid, blank or contains the ""e"".
Please enter a valid employee number."
Item_Send = False
objRecip.Delete
Item.UserProperties("EmployeeNumber")= ""
End If
End Function

What is happening now, is that I can enter a valid Employee Number, but
all
other fields (except the Memo field) is locked (won't let me backspace or
highlight/edit). If I were to click in the Memo field then one of the
other
fields, I can edit their content. Is there a way the fields can be
editible
without having to click the Memo field first?
Angie
"Sue Mosher [MVP]" wrote:

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
"".

"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?



.



  #7  
Old January 22nd 10, 07:18 PM posted to microsoft.public.outlook.program_forms
Delnang
external usenet poster
 
Posts: 23
Default Code to clear certain fields in Outlook Form

From a user's perspective, it is right after he/she clicks the message box
which would read, "Manager Employee Number is not valid..." Once the OK
button on the "error" is clicked, their cursor goes to the employee number
field. User is allowed to type a new value in Employee Number. However, all
other fields are "locked" meaning one could put their cursor in a field /
backspace or highlight and click delete but nothing happens. However, if
(the user) clicks within the Memo field then out to one of the other fields
(i.e. name, d.o.b) the field is "unlocked" editable and one can put their
cursor in a field and backspace or highlight and click delete.

"Sue Mosher [MVP]" wrote:

Exactly when are you seeing this problem?
--
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
...
Sue - Thank you!!! I'll remember that...VBScript not JScript. I think I
have one last question. The VBScript I have now is 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 not valid, blank or contains the ""e"".
Please enter a valid employee number."
Item_Send = False
objRecip.Delete
Item.UserProperties("EmployeeNumber")= ""
End If
End Function

What is happening now, is that I can enter a valid Employee Number, but
all
other fields (except the Memo field) is locked (won't let me backspace or
highlight/edit). If I were to click in the Memo field then one of the
other
fields, I can edit their content. Is there a way the fields can be
editible
without having to click the Memo field first?
Angie
"Sue Mosher [MVP]" wrote:

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
"".

"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?


.



.

  #8  
Old January 22nd 10, 08:38 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Code to clear certain fields in Outlook Form

I have no idea why other controls would be responsive, unless you have some
code on the item that sets those controls to read-only.
--
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
...
From a user's perspective, it is right after he/she clicks the message box
which would read, "Manager Employee Number is not valid..." Once the OK
button on the "error" is clicked, their cursor goes to the employee number
field. User is allowed to type a new value in Employee Number. However,
all
other fields are "locked" meaning one could put their cursor in a field /
backspace or highlight and click delete but nothing happens. However, if
(the user) clicks within the Memo field then out to one of the other
fields
(i.e. name, d.o.b) the field is "unlocked" editable and one can put their
cursor in a field and backspace or highlight and click delete.

Sue - Thank you!!! I'll remember that...VBScript not JScript. I think
I
have one last question. The VBScript I have now is 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 not valid, blank or contains the
""e"".
Please enter a valid employee number."
Item_Send = False
objRecip.Delete
Item.UserProperties("EmployeeNumber")= ""
End If
End Function

What is happening now, is that I can enter a valid Employee Number, but
all
other fields (except the Memo field) is locked (won't let me backspace
or
highlight/edit). If I were to click in the Memo field then one of the
other
fields, I can edit their content. Is there a way the fields can be
editible
without having to click the Memo field first?
Angie
"Sue Mosher [MVP]" wrote:

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
"".

"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?


.



.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move fields in custom form to "user-defined fields in folde austex Outlook - Using Contacts 0 January 10th 08 12:51 AM
it is possible to clear the form cache of Outlook via logon script Yahawa Outlook and VBA 1 November 30th 06 05:24 PM
How to replace Default Contact form with Customised conact form using VBScript code Satish Boddapati Outlook - Using Contacts 0 October 12th 06 09:20 AM
How to replace Default Contact form with Customised conact form using VBScript code Satish Boddapati Outlook - Installation 0 October 12th 06 09:19 AM
Couldn't open user defined form and clear cache Lucia Outlook and VBA 3 September 6th 06 11:48 AM


All times are GMT +1. The time now is 01:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.