|
-
Feb 17th, 2000, 10:54 PM
#1
Thread Starter
New Member
I'm working with an outlook form and trying to get some code that will look at which check boxes are checked and depending on which ones are checked enters data into the TO: field and to another custom field. However when I send the form to others they get an error:
Cannot complete operation. One or more parameter values are not valid.
The code that I am using is:
Option Explicit
'
' Send only to the first person in the To field,
' Save other people in the To field into the RouteTo field.
'
Function Item_Send()
Dim i
Dim bDelete
Dim prpRouteTo
i = InStr(Item.To, ";")
If i = 0 Then
i = InStr(Item.To, ",")
End If
If i Then
Set prpRouteTo = Item.UserProperties("RouteTo")
prpRouteTo.Value = Mid(Item.To, i + 1)
bDelete = False
i = 1
While i <= Item.Recipients.Count
If Recipients.Item(i).Type = 1 Then ' olTo
If bDelete Then
Recipients.Item(i).Delete
Else
i = i + 1
bDelete = True
End If
Else
i = i + 1
End If
Wend
Else
Set prpRouteTo = Item.UserProperties("RouteTo")
prpRouteTo.Value = ""
End If
End Function
'
' Route message to people in the RouteTo field
'
Function Item_CustomAction(ByVal Action, ByVal NewItem)
Dim prpRouteTo
Dim i
Select Case Action.Name
' Case "Route"
Case "Send"
Set prpRouteTo = NewItem.UserProperties("RouteTo")
If prpRouteTo.Value <> "" Then
Item_CustomAction = True
NewItem.To = prpRouteTo.Value
prpRouteTo.Value = ""
Else
Item_CustomAction = False
End If
Case Else
Item_CustomAction = True
End Select
End Function
Sub cmdProcess_Click
If Item.UserProperties("Accounting Main Menu Checkbox") = True AND Item.UserProperties("EQP") = True Then
Item.UserProperties("Group Code") = "LL096"
Item.UserProperties("To") = "[email protected];[email protected]"
Item.UserProperties("Progress Field") = "Finished"
ElseIf Item.UserProperties("OP") = True AND Item.UserProperties("EQP") = True AND Item.UserProperties("ITR") = True Then
Item.UserProperties("Group Code") = "LL095"
Item.UserProperties("To") = "[email protected];[email protected];[email protected]"
Item.UserProperties("Progress Field") = "Finished"
ElseIf Item.UserProperties("OperationsMenuCheckbox").Value = True AND Item.UserProperties("EQP").Value = True AND Item.UserProperties("BKG").Value = True AND Item.UserProperties("Maintenance Repair Menu Checkbox").Value = True AND Item.UserProperties("Operations Menu Checkbox").Value = True Then
Item.UserProperties("Group Code").Value = "LL034"
Item.UserProperties("To") = "[email protected];[email protected]"
Item.UserProperties("Progress Field").Value = "Finished"
Else
Item.UserProperties("Group Code") = "No Code Available"
Item.UserProperties("To") = "Glass, Stanley;[email protected]"
Item.UserProperties("Progress Field") = "Finished"
End If
End Sub
Thanks for any help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|