archiving msgs in public folder w/ redemption

S

srallen

I'm looking for a best practice method to solve the following:

I have a public folder with ~12K msgs in it. A web application that I
use stores the EntryIDs of each of those messages so that users can
call up the message in Outlook from the web app via the
"outlook://entryid" link format.

I need to archive the msgs in this folder by year by setting up
subfolders for each year off the root, but I can't just move the msgs
manually or all the EntryIDs will change and the links in the web app
will be lost.

So I'm going to write a quick C# app to access the folder, find what I
need to move, move them 1 at a time and update the EntryIDs in the DB
after the move is made and the new EntryID is available.

So I just downloaded the new version of Redemption and noticed the new
RDO objects, last time I worked with it, these were not present. I'm
wondering if I can use the RDOSearchFolder object to quickly "find" all
the messages from a given year, then do the move operation based on the
results. Do SearchFolders even work in Public Folders?

Any ideas would be helpful.. thanks!
 
D

Dmitry Streblechenko

Search Folders are not supported by the Public Folders store provider
(unlike PST and primary EX store providers), but you should still be able to
restrict the folder contents table on the created or last modified dates.
You can do that using either OOM (Items.Restrict) or Redemption
(http://www.dimastr.com/redemption/mapitable.htm).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

srallen

I'm attempting to use Restrict on the MAPITable, here is my code:
When I call Restrict, I'm getting MAPI_E_INVALID_PARAMETER.

MAPITable mytable = source.Items.MAPITable;
RestrictionAnd rest;
RestrictionProperty r1, r2;
mytable.Filter.Clear();
rest =
(RestrictionAnd)mytable.Filter.SetKind(RestrictionKind.RES_AND);
r1 =
(RestrictionProperty)rest.Add(RestrictionKind.RES_PROPERTY);
r1.relop = PropsRelop.RELOP_GE;
r1.ulPropTag = PR_MESSAGE_DELIVERY_TIME;
r1.lpProp = "1/1/2004";
r2 =
(RestrictionProperty)rest.Add(RestrictionKind.RES_PROPERTY);
r2.relop = PropsRelop.RELOP_LT;
r2.ulPropTag = PR_MESSAGE_DELIVERY_TIME;
r2.lpProp = "1/1/2005";
mytable.Filter.Restrict();

columns[0] = PR_SENDER_NAME;
columns[1] = PR_MESSAGE_DELIVERY_TIME;

mytable.Columns = columns;
mytable.GoToFirst();
row = mytable.GetRow();
while (row != null)
{
listBox1.Items.Add(row);
row = mytable.GetRow();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top