PC Review


Reply
Thread Tools Rate Thread

How to change mail path in outlook

 
 
Ashish
Guest
Posts: n/a
 
      22nd Aug 2009
In outlook addin if we save a mail (mailitem->Save) then outlook generates
an event for saving this mail which we get on exchange server in OnSyncSave.
If we saved a mail under inbox folder (say ..Inbox/mail.eml) then we'll get
same path in onsyncsave.

But when we change subject of a mail and save this, outlook generates path
for old subject mail for example
if mail subject under inbox is mail1. We change subject to mail2 and save
this mail then outlook generates path as ..Inbox/mail1 which is wrong. It
should be ..Inbox/mail2.
Also if we have a mail with subject mail1 under drafts folder and we create
a new mail with same subject and save in drafts folder, outlook generates
path as ..Drafts/mail1 which it should be ..drafts/mail1-2. And sometimes
outlook generates path for this mail in Sync Issue folder.

Can we handle this in outlook addin? Does outlook addin allows to generate
correct path? If yes please give any example.


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      24th Aug 2009
In an Outlook addin you can handle Inspectors.NewInspector() to know when an
item has been opened. You can then handle any event on that Inspector, or by
using Inspector.CurrentItem, any event on the item. You usually set up the
event handlers in the initial Activate() event of the Inspector.

Saving an item fires item.Write().

If the item hasn't been opened but was edited in the folder view (Explorer)
using in-cell editing then you'd have to handle Explorer.SelectionChange()
on the ActiveExplorer() object, then instantiate event handlers for each
member of that Selection collection.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ashish" <(E-Mail Removed)> wrote in message
news:uJ24$(E-Mail Removed)...
> In outlook addin if we save a mail (mailitem->Save) then outlook generates
> an event for saving this mail which we get on exchange server in
> OnSyncSave. If we saved a mail under inbox folder (say ..Inbox/mail.eml)
> then we'll get same path in onsyncsave.
>
> But when we change subject of a mail and save this, outlook generates path
> for old subject mail for example
> if mail subject under inbox is mail1. We change subject to mail2 and save
> this mail then outlook generates path as ..Inbox/mail1 which is wrong. It
> should be ..Inbox/mail2.
> Also if we have a mail with subject mail1 under drafts folder and we
> create a new mail with same subject and save in drafts folder, outlook
> generates path as ..Drafts/mail1 which it should be ..drafts/mail1-2. And
> sometimes outlook generates path for this mail in Sync Issue folder.
>
> Can we handle this in outlook addin? Does outlook addin allows to generate
> correct path? If yes please give any example.
>


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      25th Aug 2009
Thanks for reply. I'm doing same as you explained. Lets take the case when
open a mail.
I'm handling in Inspectors.NewInspector and accessing it using
Inspector.CurrentItem.

Suppose there is a mail in draft folder. After opening mail i change its
subject and save this mail. After saving outlook generates path for old
subject mail. Same think happen if a folder contains a mail with some
subject and i create new mail with same subject in same folder.
In all above cases i'm accessing current mail using Inspector.CurrentItem.
But outlook generates path for another mail while it was not open.
Please explain what to do. Sorry i could not get you properly.

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:On%(E-Mail Removed)...
> In an Outlook addin you can handle Inspectors.NewInspector() to know when
> an item has been opened. You can then handle any event on that Inspector,
> or by using Inspector.CurrentItem, any event on the item. You usually set
> up the event handlers in the initial Activate() event of the Inspector.
>
> Saving an item fires item.Write().
>
> If the item hasn't been opened but was edited in the folder view
> (Explorer) using in-cell editing then you'd have to handle
> Explorer.SelectionChange() on the ActiveExplorer() object, then
> instantiate event handlers for each member of that Selection collection.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:uJ24$(E-Mail Removed)...
>> In outlook addin if we save a mail (mailitem->Save) then outlook
>> generates an event for saving this mail which we get on exchange server
>> in OnSyncSave. If we saved a mail under inbox folder (say
>> ..Inbox/mail.eml) then we'll get same path in onsyncsave.
>>
>> But when we change subject of a mail and save this, outlook generates
>> path for old subject mail for example
>> if mail subject under inbox is mail1. We change subject to mail2 and save
>> this mail then outlook generates path as ..Inbox/mail1 which is wrong. It
>> should be ..Inbox/mail2.
>> Also if we have a mail with subject mail1 under drafts folder and we
>> create a new mail with same subject and save in drafts folder, outlook
>> generates path as ..Drafts/mail1 which it should be ..drafts/mail1-2. And
>> sometimes outlook generates path for this mail in Sync Issue folder.
>>
>> Can we handle this in outlook addin? Does outlook addin allows to
>> generate correct path? If yes please give any example.
>>

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      25th Aug 2009
I don't really follow what your problem is. Subject is never a good way to
track anything anyway. If an item is saved, which you can check, use the
EntryID as the unique identifier for that item, that's what it's there for.

If you have a reference to Inspector.CurrentItem then that is a fixed
reference, it doesn't relate at all to any other item open in any other
Inspector. I fail to see how they can be confused.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ashish" <(E-Mail Removed)> wrote in message
news:%23yRS%(E-Mail Removed)...
> Thanks for reply. I'm doing same as you explained. Lets take the case when
> open a mail.
> I'm handling in Inspectors.NewInspector and accessing it using
> Inspector.CurrentItem.
>
> Suppose there is a mail in draft folder. After opening mail i change its
> subject and save this mail. After saving outlook generates path for old
> subject mail. Same think happen if a folder contains a mail with some
> subject and i create new mail with same subject in same folder.
> In all above cases i'm accessing current mail using Inspector.CurrentItem.
> But outlook generates path for another mail while it was not open.
> Please explain what to do. Sorry i could not get you properly.


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      26th Aug 2009
I'm not doing anything with subject. I was using subject keyword for
folowing purpose
If we open a mailsave any mail item, we access it using
inspector.currentitem and save this mail (mailitem->Save() method) then
outlook generates a path which we get in OnSyncSave. This path contains mail
location in its folder like ..Inbox/mailsubject.eml
Before saving mail i did not change subject.
Here my question is
If any other mail (having same subject) is also there in same folder then we
get the path for old mail in onsyncsave while we did not open/access old
mail.

To generate correct path before saving mail i change many fields of current
mail but still onsyncsave shows path for another mail.

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I don't really follow what your problem is. Subject is never a good way to
>track anything anyway. If an item is saved, which you can check, use the
>EntryID as the unique identifier for that item, that's what it's there for.
>
> If you have a reference to Inspector.CurrentItem then that is a fixed
> reference, it doesn't relate at all to any other item open in any other
> Inspector. I fail to see how they can be confused.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:%23yRS%(E-Mail Removed)...
>> Thanks for reply. I'm doing same as you explained. Lets take the case
>> when open a mail.
>> I'm handling in Inspectors.NewInspector and accessing it using
>> Inspector.CurrentItem.
>>
>> Suppose there is a mail in draft folder. After opening mail i change its
>> subject and save this mail. After saving outlook generates path for old
>> subject mail. Same think happen if a folder contains a mail with some
>> subject and i create new mail with same subject in same folder.
>> In all above cases i'm accessing current mail using
>> Inspector.CurrentItem. But outlook generates path for another mail while
>> it was not open.
>> Please explain what to do. Sorry i could not get you properly.

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      26th Aug 2009
If your problems are with what's being returned by OnSyncSave as a folder
event sink then it's not an Outlook problem but a problem in the event sink.
I'd post about this in an Exchange development group. There's not much on
the Outlook end that you can do to fix what's coming in from that event
sink.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm not doing anything with subject. I was using subject keyword for
> folowing purpose
> If we open a mailsave any mail item, we access it using
> inspector.currentitem and save this mail (mailitem->Save() method) then
> outlook generates a path which we get in OnSyncSave. This path contains
> mail location in its folder like ..Inbox/mailsubject.eml
> Before saving mail i did not change subject.
> Here my question is
> If any other mail (having same subject) is also there in same folder then
> we get the path for old mail in onsyncsave while we did not open/access
> old mail.
>
> To generate correct path before saving mail i change many fields of
> current mail but still onsyncsave shows path for another mail.


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      27th Aug 2009
can you please give the link/subject for your post on event sink
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If your problems are with what's being returned by OnSyncSave as a folder
> event sink then it's not an Outlook problem but a problem in the event
> sink. I'd post about this in an Exchange development group. There's not
> much on the Outlook end that you can do to fix what's coming in from that
> event sink.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I'm not doing anything with subject. I was using subject keyword for
>> folowing purpose
>> If we open a mailsave any mail item, we access it using
>> inspector.currentitem and save this mail (mailitem->Save() method) then
>> outlook generates a path which we get in OnSyncSave. This path contains
>> mail location in its folder like ..Inbox/mailsubject.eml
>> Before saving mail i did not change subject.
>> Here my question is
>> If any other mail (having same subject) is also there in same folder then
>> we get the path for old mail in onsyncsave while we did not open/access
>> old mail.
>>
>> To generate correct path before saving mail i change many fields of
>> current mail but still onsyncsave shows path for another mail.

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      28th Aug 2009
I don't post event sinks. I said to post in an Exchange development group
about that since your problem is with your event sink, not with Outlook.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> can you please give the link/subject for your post on event sink


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the mail path Raghav Microsoft Outlook Discussion 1 13th Mar 2005 01:55 PM
Change the mail path Raghav Microsoft Outlook 1 12th Mar 2005 07:35 PM
How do I change the path of where e-mail achives are saved. =?Utf-8?B?Qm9iMTQ1Ng==?= Microsoft Outlook Installation 1 29th Jan 2005 02:33 AM
How do I change the path of where e-mail achives are saved. =?Utf-8?B?Qm9iMTQ1Ng==?= Microsoft Outlook Installation 2 28th Jan 2005 08:33 PM
Change path for Inbox in Outlook John Doe Microsoft Outlook 1 21st Jun 2004 07:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:30 AM.