L
Luke
Hi
I have created a vba function to create and save a new search, which adds
the search into the search folders in outlook. It will place the search into
my default/exchange mailbox. I would like this o be placed in and search
against items in a different store. How can i do this ?? Also i would like to
know how to search the root folder and all sub folders (Basically the whole
mailbox)
Thanks
Luke
below is the code i have been using:
Dim sch As Outlook.Search
Dim rsts As Outlook.Results
Dim i As Integer
blnSearchComp = False
Const strF As String = "urn:schemas:mailheader:subject = 'Test'"
Const strS As String = "Inbox"
Set sch = Application.AdvancedSearch(strS, strF)
sch.Save("Subject Test")
i can set the store the store
Dim objOL As Outlook.Application
Dim objNS As NameSpace
Dim objStore As Store
Set objOL = New Outlook.Application
Set objNS = objOL.GetNamespace("MAPI")
Set objStore = objNS.Stores(2)
just cant apply it to the search
I have created a vba function to create and save a new search, which adds
the search into the search folders in outlook. It will place the search into
my default/exchange mailbox. I would like this o be placed in and search
against items in a different store. How can i do this ?? Also i would like to
know how to search the root folder and all sub folders (Basically the whole
mailbox)
Thanks
Luke
below is the code i have been using:
Dim sch As Outlook.Search
Dim rsts As Outlook.Results
Dim i As Integer
blnSearchComp = False
Const strF As String = "urn:schemas:mailheader:subject = 'Test'"
Const strS As String = "Inbox"
Set sch = Application.AdvancedSearch(strS, strF)
sch.Save("Subject Test")
i can set the store the store
Dim objOL As Outlook.Application
Dim objNS As NameSpace
Dim objStore As Store
Set objOL = New Outlook.Application
Set objNS = objOL.GetNamespace("MAPI")
Set objStore = objNS.Stores(2)
just cant apply it to the search