Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / March 2008

Tip: Looking for answers? Try searching our database.

search folder in other pst

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luke - 28 Mar 2008 01:14 GMT
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
Ken Slovak - [MVP - Outlook] - 28 Mar 2008 14:44 GMT
What I usually do for that, even in Outlook 2007, is to use the 3rd party
Redemption library (www.dimastr.com/redemption). I use the
RDOStore.SearchRootFolder object for any open store. That returns an
RDOFolder object. I get the Folders collection of the search root as
RDOFolder, which returns an RDOFolders collection, which has an
AddSearchFolder method that returns an RDOSearchFolder object where I can
set up the filters and such for the search folder.

The limitations of that are you need a 3rd party library, the Redemption
search filters can be created using SQL/WebDAV syntax but you have greater
control using Extended MAPI type search conditions, and finally the search
folders created that way aren't visible in the UI.

Other than that I'd open the alternate PST as a default and set up the
search folder and then when the PST is opened as a secondary PST the search
folder will be there and visible.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi
>
[quoted text clipped - 35 lines]
>
> just cant apply it to the search
Luke - 31 Mar 2008 00:35 GMT
Thanks for the reply Ken

Unfortunately, its not viable to spend $200 usd on the redemption library to
create 5 or 6 search folders on less than 10 pc's. However it does look very
un professional. I am a bit amazed, dubfounded and defalted, given all the
hype around outlooks intergration with sharepoint, its so easy to do things
via the interface, but impossible to replicate this in any automated fashion.

examples of such, you can link via the connect to outlook option in a
discussion list. But to try and use the stssync protocol to do this via a
script is near impossible, with few to no examples available. ( i havent
found any that explain it yet or how to get the required parameters)

another example, in the outlook interface, right click and create a new
search folder in the sharepoint list, and voila, done. Try in script, and you
need to buy third party add ins and or go to each computer and do some manual
operation to be able to run an automated operation. Whats the point ???

It would be nice of the existing functionality was somehow exposed to
developers.

Luke

> What I usually do for that, even in Outlook 2007, is to use the 3rd party
> Redemption library (www.dimastr.com/redemption). I use the
[quoted text clipped - 52 lines]
> >
> > just cant apply it to the search
Luke - 31 Mar 2008 05:44 GMT
In case anyone ever wants to know another way to do this, try using send keys

eg

SendKeys "^(+P)"
SendKeys "c"
SendKeys "%(h)"

For x = 0 To i
SendKeys "{DOWN}"

Next x
SendKeys "{ }"

SendKeys "{Enter}"
SendKeys "%(e)"
SendKeys "p"
SendKeys "{Enter}"

Hope this helps. Its a bit flakey, but but working

> What I usually do for that, even in Outlook 2007, is to use the 3rd party
> Redemption library (www.dimastr.com/redemption). I use the
[quoted text clipped - 52 lines]
> >
> > just cant apply it to the search

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.