
Using Restrict and AddSpace together
Here is a task I am trying to complete using VB automation from a VB
app. I want to send folders and messages to a PST file, but only those
that were received on or after a given date. I also want to merge the
new set of folders and files with the old. So for example, the user
creats a PST file (MyPST.PST) and it sends all of the folders and
files to the file. The user comes back in a few days and runs the app
again. It will 'open' MyPST.PST and append to it only those files (and
their folders) that were received on or after the given date. The
resulting PST file will then be updated. I know the obvious answer is
to just delete and recreate the PST file, but this process could
hours. I'm trying to reduce time by only sending the files they have
not downloaded yet.
I've tried a many different things. They all work to some degree or
other, but none are ideal. The method I have settled with right now is
using SendKeys to open and control Import and Export Wizard. The
wizard does everything I need it to do. BUT.. I hate using SendKeys in
an app. Users will ultimately change windows or do something during
the process and the app will be flinging keystrokes to who knows what
application.
Anyway, I said all of that to say this: Dmitry Streblechenko's
mentioned several Outlook peices of code that have helped in me in
this learning curve. Two of them were Restrict and AddSpace. I'm
wondering now if I can use them together to quickly accomplish my
goal? I could use Restrict to return a Set of files that are on or
after the given date. I can use AddSpace to add a new PST file. Now if
I could send the new set of files to the new PST, and then append the
old PST to the new one, I'll be in bidness.
Does anyone have any comments on all of this?
tod