Sorry it's explorer.selectionchange
it's call when i change selection on any mail/folder
"Ken Slovak - [MVP - Outlook]" wrote in message
...
Do you mean the ViewSwitch() event? There is no ViewChange() event. Why
aren't you using Explorer.SelectionChange(), that would be the correct
event to handle.
--
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" wrote in message
...
I'm adding attachment in code under explorer_viewchange event(when
selecta mail item). When i add attachment to a mail in
ActiveExplorer-ViewChange event, mail item save property returns false.
But when i select another mail item item and check Save property of
previous mail item where i add attachment then it returns true. It means
that attachment is added on exchange server.
How to use in-cell editing ?? Can we avoid saving if we add an
attachment. My user is exchange server user and has cached mode on.
//in c++ event number is 0xf007
Outlook::_MailItemPtr pMailItem = NULL;
Explorer_ViewChange()
{
if(pMailItem != NULL)//if we select an item before and already add
attachment to it
{
bool issaved = pMailItem-GetSaved(); //GetSaved return true
}
else
{
Outlook::SelectionPtr spSelections = ActiveExplorer-Selection;
if( spSelections)
{
int selecteditems = spSelections-Count;
if(selecteditems == 1)
{
pMailItem = spSelections-Item(1);
pMailItem -Attachments-Add("c:/filename.txt");
bool issaved = pMailItem-GetSaved(); //GetSaved
return false
}//here i dont call pMailItem-save function
}
}
}