BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

finding sent items filtered by date (client/server regional

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Oliver Giesen
Guest





PostPosted: Wed Sep 15, 2004 12:53 pm    Post subject: finding sent items filtered by date (client/server regional Reply with quote



More Outlook madness...

I need to programmatically put sent items into a specified folder.
According to my tests and a few knowledgebase articles I could find,
doing so by simply setting MailItem.SaveSentMessageFolder will only
work with OL2003. Earlier versions will produce an error (I could
confirm this for OL2000, which is what I'm working against now).

Thus, I settled for scanning the Sent Items folder at an interval after
having sent the message I want to move and then programmatically move
it to its correct destination. In order to minimize the time taken by
this operation, I filtered the Items collection by using the Find
command with a filter string of Format("[SentOn] >= %s",
[DateTimeToStr(LastSent-CheckInterval)]). This used to work fine
already. However, I'm currently in the process of extending that
project and have set up a new Exchange Server 2000 for testing and
suddenly that exchange server is balking at the filter expression.
Could this be an issue of conflicting regional settings between client
and server? How would I be able to work around that? I cannot hardcode
a date format as this is more or less shrinkwrapware... is there maybe
a standard date format that would be recognized by the server in any
case?

What about altogether alternative approaches? Maybe I could set a
custom named property when I send the message and filter by that? I
haven't been able to get that working so far, though (that is the
filtering - I could set and get custom properties alright already).
Anything to take care of when doing something like this? I haven't
worked with custom properties before...

Maybe some other method of filtering/identfying the items that are
scheduled for move?

Ideas?

P.S.: I'm already using the Redemption Objects library, so if that
provides anything useful for my situation feel free to mention it...

Cheers,

Oliver
Back to top
Dmitry Streblechenko
Guest





PostPosted: Wed Sep 15, 2004 5:54 pm    Post subject: Re: finding sent items filtered by date (client/server regio Reply with quote



No, SaveSentMessageFolder property works in all versions. What happened when
you tried to use it?

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


"Oliver Giesen" <NO.ogware.SPAM (AT) gmx (DOT) ALLOWED.net.INVALID> wrote

Quote:
More Outlook madness...

I need to programmatically put sent items into a specified folder.
According to my tests and a few knowledgebase articles I could find,
doing so by simply setting MailItem.SaveSentMessageFolder will only
work with OL2003. Earlier versions will produce an error (I could
confirm this for OL2000, which is what I'm working against now).

Thus, I settled for scanning the Sent Items folder at an interval after
having sent the message I want to move and then programmatically move
it to its correct destination. In order to minimize the time taken by
this operation, I filtered the Items collection by using the Find
command with a filter string of Format("[SentOn] >= %s",
[DateTimeToStr(LastSent-CheckInterval)]). This used to work fine
already. However, I'm currently in the process of extending that
project and have set up a new Exchange Server 2000 for testing and
suddenly that exchange server is balking at the filter expression.
Could this be an issue of conflicting regional settings between client
and server? How would I be able to work around that? I cannot hardcode
a date format as this is more or less shrinkwrapware... is there maybe
a standard date format that would be recognized by the server in any
case?

What about altogether alternative approaches? Maybe I could set a
custom named property when I send the message and filter by that? I
haven't been able to get that working so far, though (that is the
filtering - I could set and get custom properties alright already).
Anything to take care of when doing something like this? I haven't
worked with custom properties before...

Maybe some other method of filtering/identfying the items that are
scheduled for move?

Ideas?

P.S.: I'm already using the Redemption Objects library, so if that
provides anything useful for my situation feel free to mention it...

Cheers,

Oliver



Back to top
Oliver Giesen
Guest





PostPosted: Thu Sep 16, 2004 8:17 am    Post subject: Re: finding sent items filtered by date (client/server regio Reply with quote



Dmitry Streblechenko wrote:

Quote:
No, SaveSentMessageFolder property works in all versions.

Hmm OK, then I guess this is something different after all:
http://support.microsoft.com/?kbid=321423
Rereading it now it definitely looks like it. <blush/>


Quote:
What happened when you tried to use it?

When I try to send the message (manually, not programmatically) I get a
warning dialog popup saying "The Operation failed". AFAICT by debugging
it doesn't happen anywhere in my code, so I really couldn't tell.

I tried to set the folder in the Inspector's OnActivate event handler
to the currently selected (public) folder (obtained from
Application.ActiveExplorer.CurrentFolder).

If there really is some way to make this work it would definitely save
me a lot of work!...

Cheers,

Oliver

Back to top
Oliver Giesen
Guest





PostPosted: Thu Sep 16, 2004 10:03 am    Post subject: Re: finding sent items filtered by date (client/server regio Reply with quote

Oliver Giesen wrote:

Quote:
What happened when you tried to use it?

When I try to send the message (manually, not programmatically) I get
a warning dialog popup saying "The Operation failed". AFAICT by
debugging it doesn't happen anywhere in my code, so I really couldn't
tell.

I tried to set the folder in the Inspector's OnActivate event handler
to the currently selected (public) folder (obtained from
Application.ActiveExplorer.CurrentFolder).

If there really is some way to make this work it would definitely save
me a lot of work!...

I just found some mention
(http://www.outlookcode.com/d/code/setsavefolder.htm) that
SaveSentMessageFolder only works if the specified folder is in the
default message store. This is not the case here.
If this is the case, why isn't this in the documentation for
SaveSentMessageFolder itself?

Anyway, the article gave me a good idea on a more promising approach
(using the SentItems folder's AddItem event instead of scanning the
whole folder)... trying that now.

Cheers,

Oliver

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.