
Function doesn't return an array in vb (Script) in Outlook
Hi, I am not sure if am in the right group, because I am new in
newsgroups.
I am programing forms in Outlook with the VBA Script or VB or V
Script(I don't know for sure how this is called, because it is
different than in Excel VB). I have a function that should return an
array. But it doesn't work:
'-----------------------
Sub CommandButton1_Click()
Dim array_a(3)
array_a() = test()
MsgBox aarray(0)
End Sub
'-----------------------
Function test()
Dim array_b(3)
array_b(0) = "test1 "
array_b(1) = "test2"
test = array_b
end Function
'-----------------------
Microsoft Script De{*filter*} tels me, that in the line: 'array_a() =
test()' -> "Index out of the valid range: 'array_a'" (Index auserhalb
des gltigen Bereichs:'array_a'")
I have tried: array_a = test() too, it doesn't work. I have look for
this problem the whole www for two days. I found much help for VBA
without Outlook, but those solutions don't work here. If someone has
got a good documentation or url, that helps too. Thank you very much
for you help.
bye
Andreas P.
PS:Another question would be, why I am not able to define a variable
like "Dim a as Variant" or something like that? It works with Excel,
but not in Outlook VB. :-(