M
Michael Kensy
Hi,
in OL.2k3 I wrote a sub function to gather different items matching to
conditions. That code is working fine. The problem I can't solve is how to
give back that collection object to the calling main routine.
the code looks like:
***
Function funcFindItems(Arg1As String, Arg2 As MAPIFolder) As Collection
Dim colFoundItems As New Collection
....
colFoundItems.Add objItem
....
If Not IsNothing(colFoundItems) Then Set funcFindItems = colFoundItems
Wayout:
Set colFoundItems = Nothing
Exit Function
***
The problem I have seems to be related to the collection object itself
because colFoundItems gathers all objects I'am looking for but they get
lost at line
Set funcFindItems = colFoundItems
It seems to be necessary to dimension that function as NEW Collection but
it doesn't seem to be possible
in OL.2k3 I wrote a sub function to gather different items matching to
conditions. That code is working fine. The problem I can't solve is how to
give back that collection object to the calling main routine.
the code looks like:
***
Function funcFindItems(Arg1As String, Arg2 As MAPIFolder) As Collection
Dim colFoundItems As New Collection
....
colFoundItems.Add objItem
....
If Not IsNothing(colFoundItems) Then Set funcFindItems = colFoundItems
Wayout:
Set colFoundItems = Nothing
Exit Function
***
The problem I have seems to be related to the collection object itself
because colFoundItems gathers all objects I'am looking for but they get
lost at line
Set funcFindItems = colFoundItems
It seems to be necessary to dimension that function as NEW Collection but
it doesn't seem to be possible