|
-
Sep 1st, 2009, 07:54 AM
#1
Thread Starter
Member
Type Mismatch Error
I have an double array which I would like to get the value of one of it's members and assign it to the To field of an outlook form. However, I receive a type mismatch: Employees Error.
HTML Code:
Function Item_Open()
Dim FormPage, Control
Set FormPage = Item.GetInspector.ModifiedFormPages("Message")
Set Control = FormPage.Controls("TypeCombo")
Control.PossibleValues = "Sign In;Lunch Out;Lunch In;Sign Out"
Dim Employees(30,5)
Employees(0,0) = "John"
Employees(0,1) = "[email protected]"
End Function
Sub Item_CustomPropertyChange(ByVal Name)
Dim FormPage, Control
Set FormPage = Item.GetInspector.ModifiedFormPages("Message")
Set Control = FormPage.Controls("TypeCombo")
Select Case Name
Case "TypeCombo"
SupervisorEmail = Employees(0,1).value
If Control.ListIndex = 0 Then
Item.Subject = "Sign In"
Item.To = SupervisorEmail
End If
If Control.ListIndex = 1 Then
Item.Subject = "Lunch Out"
Item.To = SupervisorEmail
End If
If Control.ListIndex = 2 Then
Item.Subject = "Lunch In"
End If
If Control.ListIndex = 3 Then
Item.Subject = "Sign Out"
End If
End Select
End Sub
-
Sep 1st, 2009, 09:07 AM
#2
Re: Type Mismatch Error
Take off the ".value".
Code:
SupervisorEmail = Employees(0,1)
-
Sep 1st, 2009, 09:11 AM
#3
Thread Starter
Member
-
Sep 1st, 2009, 09:22 AM
#4
Re: Type Mismatch Error
I don't see SupervisorEmail declared? Could that be the problem?
-
Sep 1st, 2009, 09:47 AM
#5
Thread Starter
Member
Re: Type Mismatch Error
Doh. didnt catch that but even with that change it gives the same error.
Dim SupervisorEmail
SupervisorEmail = Employees(0,1)
If Control.ListIndex = 0 Then
Item.Subject = "Sign In"
Could it be something with the way I am assigning the array item to something I would think expects a string... Which begs the question is there a toString() equivalent or need for one?
For this line. SupervisorEmail = Employees(0,1)
-
Sep 1st, 2009, 10:26 AM
#6
Addicted Member
Re: Type Mismatch Error
All of your variables don't have a type defined. Perhaps it will help if you set the specific types of your variables.
Cheers.
-Elio
---
REMEMBER: If your issue is resolved, use the Thread Tools menu to set it as such, and be sure to rate the posts that help you the most!

Just because I was jealous of g4hsean! 
-
Sep 1st, 2009, 10:42 AM
#7
Re: Type Mismatch Error
Maybe move Dim Employees(30,5) to the top of your script as a global declare. It's scope may only apply to the Item_Open function -- I'm not a vbscript guru, just applying an educated guess.
-
Sep 1st, 2009, 03:38 PM
#8
Thread Starter
Member
Re: Type Mismatch Error
Apparently that was it Just needed to move the declaration to the top of the script. Thanks !
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
|