Outlook 2003 VBA - AdvancedSearch in a personal folder (*.pst data file)

Hello,

I'm trying to create a searchfolder in a personal folder (*.pst data file). But I don't know how to create them. I have used the advancedsearch method but it looks like as this method can only be used in the current email account and not in a *.pst data file.

this is my code to create a searchfolder object in the current email account:


PrivateSub Demo()

Dim objSearchAs Search

Const strWhatAsString = "urn:schemas:mailheader:subject ='Test'"
Const strWhere As String = "Inbox"

Set objSearch = Application.AdvancedSearch(strWhere, strWhat)
objSearch.Save "Demo"

End Sub

Now I have tried to change to constant 'strWhere' to search in a *.pst data file like this:


strWhere = "\\Archive_2005"
strWhere = "Archive_2005"
strWhere = "P:\Outlook\Archive_2005.pst"'original path

In each above cases I have received a runtime error.

Is somebody here who know how I can do that?

Thanks for your efforts.

[1752 byte] By [FreakFrossard] at [2007-12-17]
# 1
I have solved the problem Big Smile For interested peoples:

http://support.microsoft.com/default.aspx?scid=kb;en-us;326244

FreakFrossard at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...