Hi,
I have following code in this outlook session
And I have some code in below module
It seems the AdvancedSearch is never complete. I do see the message box but the code continuously loops in the While...Wend, never proceed to the next line.
What's wrong?
I have following code in this outlook session
Code:
Public searchComplete As Boolean
Private Sub Application_AdvancedSearchComplete(ByVal SearchObject As Search)
MsgBox "Completed"
searchComplete = True
End Sub
And I have some code in below module
Code:
searchComplete = False
Set oSearch = Application.AdvancedSearch(Scope:=strScope, Filter:=strDASLFilter, SearchSubFolders:=True, Tag:="SearchFolder")
While searchComplete = False
DoEvents
Wend
It seems the AdvancedSearch is never complete. I do see the message box but the code continuously loops in the While...Wend, never proceed to the next line.
What's wrong?