Using Restrict and AddSpace together 
Author Message
 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



Thu, 19 May 2005 04:17:07 GMT  
 Using Restrict and AddSpace together
Well, you can always create a new PST file with only a recent subset of the
files. Then you can merge messages in that file with an existing PST file by
programmatically copying folders from a new PST file into an old one.

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


Quote:
> 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



Sat, 21 May 2005 06:03:55 GMT  
 Using Restrict and AddSpace together
Great! Could you please help me with this? I think I could figure out
how to copy the files from the old PST to the new, but how could I
create a PST that contains only the files that meet my criteria? I'm
trying to avoid the Import and Export Wizard if I can. The other idea I
had is to make a set of files that meet the criteria, using Restrict,
then cycle through them to find out what folder they belong to and move
them to the PST using that information. Could you nudge me a little more
in the right direction?

tod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 21 May 2005 11:52:41 GMT  
 Using Restrict and AddSpace together
Create a blank PST file, recursively loop through each source folder,
restrict the Items collection, create a target folder is necessary, copy
each message from the restricted source collection to the target folder.

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


Quote:
> Great! Could you please help me with this? I think I could figure out
> how to copy the files from the old PST to the new, but how could I
> create a PST that contains only the files that meet my criteria? I'm
> trying to avoid the Import and Export Wizard if I can. The other idea I
> had is to make a set of files that meet the criteria, using Restrict,
> then cycle through them to find out what folder they belong to and move
> them to the PST using that information. Could you nudge me a little more
> in the right direction?

> tod

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sun, 22 May 2005 03:26:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Crystal 4.5: Keep together does not keep together...

2. Using like conditions with restrict method

3. Using Outlook's Restrict and Filter Functions for email addresses

4. error using Restrict on entryID -2147352567 (VB)

5. using Restrict items method

6. Creating Items collection using Find method instead of Restrict

7. Using Restrict Method

8. Partial Matches using Restrict or Find

9. Using Outlook's Restrict and Filter Functions for email addresses

10. merging documents together using vbscript

11. Problems using VB 4.0 and OO4O together...

12. Using Text and Graphics Together

 

 
Powered by phpBB® Forum Software