View Single Post
  #9  
Old April 25th 08, 07:50 PM posted to microsoft.public.outlook.program_addins
Tim Pulley
external usenet poster
 
Posts: 10
Default Access to MailItem properties before opening new inspector ?

Marcin,

As an alternative to searching you could hook the Item's Forward, Reply and
Reply All events. By hooking these events you can take control of creation
of the forward/reply message and can copy data from the original message to
the new message. This approach requires a little more coding because you'll
need to process the Explorer's Selection event. Since users can run multiple
instances of Outlook, you'll also need to keep track of which items you've
already hooked. If you don't, you'll end up with multiple calls to your
event handler.


"Sue Mosher [MVP-Outlook]" wrote in message
...
You're using the Find/Restrict format for the search filter string, but
AdvancedSearch requires the DASL syntax; see
http://www.outlookcode.com/news.aspx?id=30.

Also, if you're searching only default folders, I don't think you need the
full path in the scope string, so a string like this should work:

"'Sent Items','Inbox', 'Deleted Items'"

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Marcin" wrote in message
...
There must be some kind of caching, I don't exactly know what kind of, but
in
fact, I would like to prevent caching at all :-), or get possibility of
reading items from cache before they are displayed in inspectors or
explorers.

Anyway, thanks a lot for You hint on ConversationTopic. I started playing
with it, however, experienced a small problem using
Application.AdvancedSearch :
string filter = "[ConversationTopic] = '" + Item.ConversationTopic + "'" ;
try
{
StringBuilder SearchScope = new StringBuilder("'" +
Application.Session.GetDefaultFolder(Outlook.OlDef aultFolders.olFolderSentMail).FolderPath
+ "'");
SearchScope.Append(",'" +
Application.Session.GetDefaultFolder(Outlook.OlDef aultFolders.olFolderInbox).FolderPath
+ "'");
SearchScope.Append(",'" +
Application.Session.GetDefaultFolder(Outlook.OlDef aultFolders.olFolderDeletedItems).FolderPath
+ "'");
//exception is caught on line below - "The operation failed."
Outlook.Search SearchPotentialParents =
Application.AdvancedSearch(SearchScope.ToString(), filter, true,
ThisAddIn.AdvancedParentSearchTag);
}

Any idea why would it fail ? The error message is not really meaningful
:-(

kind regards

marcin

"Sue Mosher [MVP-Outlook]" wrote:

What cache are you referring to? I can think of at least three different
contexts in which "cache" would be relevant. Please start a new topic
thread with more details.

"Marcin" wrote in message
...
Thanks a lot,Sue, will have a look at this immediatelly.

By the way - do you happen to have any references on Outlook caching
and
cache access/manipulation from API ?

Kind regards

marcin

"Sue Mosher [MVP-Outlook]" wrote:

You might find the sample code at
http://www.outlookcode.com/codedetail.aspx?id=1714 useful, as it shows
how to use the value of the ConversationIndex property to locate the
original item from which a reply or forward was created.

"Marcin" wrote in message
...

To make it short - when executing action like reply or forward on
MailItem,
I need to access the original message.





Ads