How to change mail path in outlook

Status
Not open for further replies.
A

Ashish

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.
 
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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:uJ24$TyIKHA.3632@TK2MSFTNGP05.phx.gbl...
> 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.
>
 
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.
<kenslovak@mvps.org> wrote in message

news:On%23l7yLJKHA.4232@TK2MSFTNGP02.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:uJ24$TyIKHA.3632@TK2MSFTNGP05.phx.gbl...
> > 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.
> >

>
 
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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:%23yRS%23zXJKHA.356@TK2MSFTNGP05.phx.gbl...
> 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.
 
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.
<kenslovak@mvps.org> wrote in message

news:e0uhmrYJKHA.1252@TK2MSFTNGP04.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:%23yRS%23zXJKHA.356@TK2MSFTNGP05.phx.gbl...
> > 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.

>
 
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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:u4D4qijJKHA.4232@TK2MSFTNGP02.phx.gbl...
> 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.
 
can you please give the link/subject for your post on event sink
<kenslovak@mvps.org> wrote in message

news:u9nLLGlJKHA.4392@TK2MSFTNGP04.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:u4D4qijJKHA.4232@TK2MSFTNGP02.phx.gbl...
> > 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.

>
 
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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:ObE1NyxJKHA.4608@TK2MSFTNGP02.phx.gbl...
> can you please give the link/subject for your post on event sink
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
O On click,I want to change subject line of selected mail and then reply to particular email and move Using Outlook 3
Diane Poremsky To Change the Default E-mail Program in Windows Using Outlook 0
C Change From address while sending a new mail Outlook VBA and Custom Forms 5
David Rahrer Change default Junk E-Mail folder Using Outlook 6
Danny2015 how to change incoming mail conversationtopic successfully Outlook VBA and Custom Forms 6
K How to change status of a mail marked as a task (VBA) Outlook VBA and Custom Forms 2
B Macro to Change sort and collapse groups in Mail folder Outlook VBA and Custom Forms 9
D Mail Format Changes from HTML to RTF Upon Forward - How to change Outlook VBA and Custom Forms 7
A change mail format Outlook VBA and Custom Forms 5
M Change the account from sending e-mail Outlook VBA and Custom Forms 3
S how to add my custom items to "Change E-mail Account" dialog Outlook VBA and Custom Forms 1
V major issue in outlook "Change in forward mail also change selected mail " Outlook VBA and Custom Forms 1
A why outlook change forward mail Outlook VBA and Custom Forms 2
A How to change message format while forwarding a mail Outlook VBA and Custom Forms 1
C How do I change the default character spacing in Outlook e-mail? Using Outlook 3
M Use Macro to change account settings Outlook VBA and Custom Forms 0
D Unable to change AppointmentItem.Start property Outlook VBA and Custom Forms 3
sjmo2 Change subject for new e-mails only. Outlook VBA and Custom Forms 2
Horsepower Contact phone numbers randomly change Using Outlook 0
P Outlook 2016 Change Paste Special Default Format Using Outlook 8
whizzard Change FROM address based on TO or CC address Outlook VBA and Custom Forms 8
S Outlook 365 Can I change the possible range of highlighting colours when writing an Outlook email? Using Outlook 1
V Can one change the formatting of email title blocks? Using Outlook 0
S Unable to change Message Class Outlook VBA and Custom Forms 0
S New Outlook Appointment - Select All Body Text and Change Font and Size Outlook VBA and Custom Forms 1
J VBA Cannot programmatically input or change Value for User Defined field Using Outlook 1
C Outlook 365 Can you change the follow up colour? Using Outlook 1
A Change settings Send/receive VBA Outlook VBA and Custom Forms 0
E Outlook VBA change GetDefaultFolder dynamically Outlook VBA and Custom Forms 6
O What would be the recommended way to change an email address (family member)? Using Outlook 0
S Change "This Week" flag start date behavior Using Outlook 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
D Change Microsoft Account password - what to do to update on all devices Using Outlook 4
S Outlook 2016 Change how Outlook shows me contacts in emails Using Outlook 0
Witzker HowTo Change message Class of contact form Outlook VBA and Custom Forms 0
Z Outlook 365 delete reminder you can’t make change to contents of this-read only folder Using Outlook 4
Witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
R How to Change Margins In Google Docs...? Using Outlook 0
e_a_g_l_e_p_i Outlook 2010 How can I change the font size on right side appointment pane Using Outlook 12
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
B Change Font and Font size using VBA Outlook VBA and Custom Forms 9
D Change senders title Using Outlook 1
W Recurrence: delete older occurrences / change earliest start time Outlook VBA and Custom Forms 0
E Change sending account depending on Subjectline Outlook VBA and Custom Forms 0
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 10
B Change row background color of selected item Using Outlook 1
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
B Change from Address Outlook VBA and Custom Forms 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1

Similar threads

Back
Top