Can anyone tell me why the code below is giving me this error?<br>
<br>
Could not complete the operation. One or more parameter values are not valid.<br>
<br>
The code below is used behind a form used in MS Outlook. The form is filled in by a user and then sent on to the proper personel one by one. However after the user sends it on the the next person is unable to send it from their email as they get the above error. Thanks for any help.<br>
<br>
----StartCode----<br>
<br>
Option Explicit<br>
<br>
'<br>
' Send only to the first person in the To field,<br>
' Save other people in the To field into the RouteTo field.<br>
'<br>
Function Item_Send()<br>
Dim i<br>
Dim bDelete<br>
Dim prpRouteTo<br>
i = InStr(Item.To, ";"
<br>
If i = 0 Then<br>
i = InStr(Item.To, ","
<br>
End If<br>
If i Then<br>
Set prpRouteTo = Item.UserProperties("RouteTo"
<br>
prpRouteTo.Value = Mid(Item.To, i + 1)<br>
bDelete = False<br>
i = 1<br>
While i <= Item.Recipients.Count<br>
If Recipients.Item(i).Type = 1 Then ' olTo<br>
If bDelete Then<br>
Recipients.Item(i).Delete<br>
Else<br>
i = i + 1<br>
bDelete = True<br>
End If<br>
Else<br>
i = i + 1<br>
End If<br>
Wend<br>
Else<br>
Set prpRouteTo = Item.UserProperties("RouteTo"
<br>
prpRouteTo.Value = ""<br>
End If<br>
End Function<br>
<br>
'<br>
' Route message to people in the RouteTo field<br>
'<br>
Function Item_CustomAction(ByVal Action, ByVal NewItem)<br>
Dim prpRouteTo<br>
Dim i<br>
Select Case Action.Name<br>
Case "Route"<br>
Set prpRouteTo = NewItem.UserProperties("RouteTo"
<br>
If prpRouteTo.Value <> "" Then<br>
Item_CustomAction = True<br>
NewItem.To = prpRouteTo.Value<br>
prpRouteTo.Value = ""<br>
Else<br>
Item_CustomAction = False<br>
End If<br>
Case Else<br>
Item_CustomAction = True<br>
End Select<br>
End Function<br>
<br>
Sub cmdProcess_Click<br>
If Item.UserProperties("Accounting Main Menu Checkbox"
= True AND<br>
Item.UserProperties("EQP"
= True Then<br>
Item.UserProperties("Group Code"
= "LL096"<br>
Item.To = "<A HREF="mailto:bo@schmo.com">bo@schmo.com</A>;<A HREF="mailto:joe@schmo.com">joe@schmo.com</A>"<br>
Item.UserProperties("Progress Field"
= "Finished"<br>
Else<br>
Item.UserProperties("Group Code"
= "LL095"<br>
Item.To = "<A HREF="mailto:john@doe.com">john@doe.com</A>"<br>
Item.UserProperties("Progress Field"
= "Finished"<br>
End If<br>
End Sub<br>
<br>
----EndCode----
<br>
Could not complete the operation. One or more parameter values are not valid.<br>
<br>
The code below is used behind a form used in MS Outlook. The form is filled in by a user and then sent on to the proper personel one by one. However after the user sends it on the the next person is unable to send it from their email as they get the above error. Thanks for any help.<br>
<br>
----StartCode----<br>
<br>
Option Explicit<br>
<br>
'<br>
' Send only to the first person in the To field,<br>
' Save other people in the To field into the RouteTo field.<br>
'<br>
Function Item_Send()<br>
Dim i<br>
Dim bDelete<br>
Dim prpRouteTo<br>
i = InStr(Item.To, ";"
If i = 0 Then<br>
i = InStr(Item.To, ","
End If<br>
If i Then<br>
Set prpRouteTo = Item.UserProperties("RouteTo"
prpRouteTo.Value = Mid(Item.To, i + 1)<br>
bDelete = False<br>
i = 1<br>
While i <= Item.Recipients.Count<br>
If Recipients.Item(i).Type = 1 Then ' olTo<br>
If bDelete Then<br>
Recipients.Item(i).Delete<br>
Else<br>
i = i + 1<br>
bDelete = True<br>
End If<br>
Else<br>
i = i + 1<br>
End If<br>
Wend<br>
Else<br>
Set prpRouteTo = Item.UserProperties("RouteTo"
prpRouteTo.Value = ""<br>
End If<br>
End Function<br>
<br>
'<br>
' Route message to people in the RouteTo field<br>
'<br>
Function Item_CustomAction(ByVal Action, ByVal NewItem)<br>
Dim prpRouteTo<br>
Dim i<br>
Select Case Action.Name<br>
Case "Route"<br>
Set prpRouteTo = NewItem.UserProperties("RouteTo"
If prpRouteTo.Value <> "" Then<br>
Item_CustomAction = True<br>
NewItem.To = prpRouteTo.Value<br>
prpRouteTo.Value = ""<br>
Else<br>
Item_CustomAction = False<br>
End If<br>
Case Else<br>
Item_CustomAction = True<br>
End Select<br>
End Function<br>
<br>
Sub cmdProcess_Click<br>
If Item.UserProperties("Accounting Main Menu Checkbox"
Item.UserProperties("EQP"
Item.UserProperties("Group Code"
Item.To = "<A HREF="mailto:bo@schmo.com">bo@schmo.com</A>;<A HREF="mailto:joe@schmo.com">joe@schmo.com</A>"<br>
Item.UserProperties("Progress Field"
Else<br>
Item.UserProperties("Group Code"
Item.To = "<A HREF="mailto:john@doe.com">john@doe.com</A>"<br>
Item.UserProperties("Progress Field"
End If<br>
End Sub<br>
<br>
----EndCode----