Active explorer issue

Status
Not open for further replies.
A

Ashish

In Active inspector when open a mail, If add an attachment to a mail and

dont call Save function then this attachment will not update on exchange

server for this mail.

But In active explorer when select a mail we add attachment to a mail and

dont save save function. Attachment is updated on exchange server for this

mail. Is there any reason for that? Can we avoid saving? Outlook

version-2003
 
K

Ken Slovak - [MVP - Outlook]

How are you adding an attachment in ActiveExplorer()? Is it with code or

from the UI. If using code show it.

In general you always have to save, possibly unless in-cell editing is

enabled and that affects automatically saving any changes. See if the Saved

property on the item has changed after you add the attachment in the

Explorer.

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

news:e2xdzUmJKHA.4432@TK2MSFTNGP05.phx.gbl...
> In Active inspector when open a mail, If add an attachment to a mail and
> dont call Save function then this attachment will not update on exchange
> server for this mail.

> But In active explorer when select a mail we add attachment to a mail and
> dont save save function. Attachment is updated on exchange server for this
> mail. Is there any reason for that? Can we avoid saving? Outlook
> version-2003
>
 
A

Ashish

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

}

}

}
<kenslovak@mvps.org> wrote in message

news:ONIzo6oJKHA.4004@TK2MSFTNGP05.phx.gbl...
> How are you adding an attachment in ActiveExplorer()? Is it with code or
> from the UI. If using code show it.

> In general you always have to save, possibly unless in-cell editing is
> enabled and that affects automatically saving any changes. See if the
> Saved property on the item has changed after you add the attachment in the
> Explorer.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:e2xdzUmJKHA.4432@TK2MSFTNGP05.phx.gbl...
> > In Active inspector when open a mail, If add an attachment to a mail and
> > dont call Save function then this attachment will not update on exchange
> > server for this mail.
>

>> But In active explorer when select a mail we add attachment to a mail and
> > dont save save function. Attachment is updated on exchange server for
> > this mail. Is there any reason for that? Can we avoid saving? Outlook
> > version-2003
> >

>
 
K

Ken Slovak - [MVP - Outlook]

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.

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

news:OkzUGxxJKHA.4004@TK2MSFTNGP05.phx.gbl...
> 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
> }
> }
> }
 
A

Ashish

Sorry it's explorer.selectionchange

it's call when i change selection on any mail/folder
<kenslovak@mvps.org> wrote in message

news:%23QhFJ0xJKHA.1340@TK2MSFTNGP05.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:OkzUGxxJKHA.4004@TK2MSFTNGP05.phx.gbl...
> > 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
> > }
> > }
> > }

>
 
K

Ken Slovak - [MVP - Outlook]

If you want to know whether or not an item in a Selection is changed you

handle SelectionChange(). When that fires you get the new Selection. You can

then set up handlers for each item in the Selection and handle the

AttachmentAdd() event or the BeforeAttachmentSave() event or any other

attachment related event you want to track.

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

news:uG1ck8xJKHA.1252@TK2MSFTNGP04.phx.gbl...
> Sorry it's explorer.selectionchange
> it's call when i change selection on any mail/folder
 
A

Ashish

So if i handle those attachment events and avoid saving then it will not

update on exchange server. But will it allow to add attachment to mail and

display in outlook when we select a mail?
<kenslovak@mvps.org> wrote in message

news:egziUR%23JKHA.5956@TK2MSFTNGP03.phx.gbl...
> If you want to know whether or not an item in a Selection is changed you
> handle SelectionChange(). When that fires you get the new Selection. You
> can then set up handlers for each item in the Selection and handle the
> AttachmentAdd() event or the BeforeAttachmentSave() event or any other
> attachment related event you want to track.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:uG1ck8xJKHA.1252@TK2MSFTNGP04.phx.gbl...
> > Sorry it's explorer.selectionchange
> > it's call when i change selection on any mail/folder

>
 
K

Ken Slovak - [MVP - Outlook]

Why not try it and see?

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

news:eFcBT$%23JKHA.3632@TK2MSFTNGP05.phx.gbl...
> So if i handle those attachment events and avoid saving then it will not
> update on exchange server. But will it allow to add attachment to mail and
> display in outlook when we select a mail?
 
A

Ashish

i tried it but attachment still save on exchange server. I handle

beforeattachmentsave and addattachment and cancel the saving but attachment

still save on exchange server. I follow below link to avoid saving

http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/

To avoid saving when i select another mail i delete attachments from

previous mail and call save function. But this modify mail date. I want to

add attachment in mail without modifying its date.
<kenslovak@mvps.org> wrote in message

news:eSlOLWCKKHA.4236@TK2MSFTNGP04.phx.gbl...
> Why not try it and see?

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:eFcBT$%23JKHA.3632@TK2MSFTNGP05.phx.gbl...
> > So if i handle those attachment events and avoid saving then it will not
> > update on exchange server. But will it allow to add attachment to mail
> > and display in outlook when we select a mail?

>
 
K

Ken Slovak - [MVP - Outlook]

I'm afraid what you want can't be done. If you modify an item it will get

some date related fields also modified. Not much you can do about that.

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

news:%23T41tWvKKHA.4236@TK2MSFTNGP04.phx.gbl...
> i tried it but attachment still save on exchange server. I handle
> beforeattachmentsave and addattachment and cancel the saving but attachment
> still save on exchange server. I follow below link to avoid saving
> http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/

> To avoid saving when i select another mail i delete attachments from
> previous mail and call save function. But this modify mail date. I want to
> add attachment in mail without modifying its date.
 
A

Ashish

To modify item i'm only adding attachment for a selected item in outlook

explorer. And when select another item i delete attachment from previous

item where i add. All this i'm doing without saving item. But this action

save item on exchange server. But we can avoid this saving as below link

says that

http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/

My motive is to display attachments when select a item and delete them when

select another item. And this all should not modify on exchange server.

It it not possible?
<kenslovak@mvps.org> wrote in message

news:udCKjVwKKHA.4168@TK2MSFTNGP05.phx.gbl...
> I'm afraid what you want can't be done. If you modify an item it will get
> some date related fields also modified. Not much you can do about that.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:%23T41tWvKKHA.4236@TK2MSFTNGP04.phx.gbl...
> >i tried it but attachment still save on exchange server. I handle
> >beforeattachmentsave and addattachment and cancel the saving but
> >attachment still save on exchange server. I follow below link to avoid
> >saving
> > http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/
>

>
>> To avoid saving when i select another mail i delete attachments from
> > previous mail and call save function. But this modify mail date. I want
> > to add attachment in mail without modifying its date.

>
 
K

Ken Slovak - [MVP - Outlook]

I don't think what you want is possible, no. Not using the Outlook object

model anyway.

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

news:eK8qe8wKKHA.3424@TK2MSFTNGP02.phx.gbl...
> To modify item i'm only adding attachment for a selected item in outlook
> explorer. And when select another item i delete attachment from previous
> item where i add. All this i'm doing without saving item. But this action
> save item on exchange server. But we can avoid this saving as below link
> says that
> http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/

> My motive is to display attachments when select a item and delete them
> when select another item. And this all should not modify on exchange
> server.
> It it not possible?
 
A

Ashish

oh. It means i need to change my design again. To complete my task there is

one more way. I am adding an empty attachment to a mail on exchange server

using CDO. But when i see this mail in outlook/owa, i found attachment size

is change. it's 4 bytes or 64 bytes or 128 bytes. Dont know why but outlook

shows its size. I think if attachment size is 0 bytes then outlook will not

display it in right pane. When i open this attachment in outlook it has no

data. Can i hide this attachment? Means it should not display in right pane

when i select this mail in active explorer. Using CDO when i add this

attachment on exchange server i did not find any way to hide it. So i try in

outlook. I'm using following code to hide it in outlook. Code execute when

click on a mail(which has empty attachment) in active explorer.

Suppose mail item has one empty attachment

LPMESSAGE lpMessage = (IMessage*)(IUnknown*)

mailitem->Attachments->Item(1)->MAPIOBJECT;

SPropValue pProp;

pProp.ulPropTag = PR_ATTACHMENT_HIDDEN;

pProp.Value.b = true;

HRESULT hr = HrSetOneProp(lpMessage, &pProp);

if(hr == S_OK)

lpMessage->SaveChanges(FORCE_SAVE);

Also i have tried to change other properties like PR_ATTACH_METHOD,

PR_ATTACH_FILE_NAME etc. but nothing happed. I have tried not to use

SaveChanges method but no result.
<kenslovak@mvps.org> wrote in message

news:O%233u6bxKKHA.3708@TK2MSFTNGP02.phx.gbl...
> I don't think what you want is possible, no. Not using the Outlook object
> model anyway.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:eK8qe8wKKHA.3424@TK2MSFTNGP02.phx.gbl...
> > To modify item i'm only adding attachment for a selected item in outlook
> > explorer. And when select another item i delete attachment from previous
> > item where i add. All this i'm doing without saving item. But this action
> > save item on exchange server. But we can avoid this saving as below link
> > says that
> > http://codeidol.com/csharp/c-sharp-in-office/Working-with-Outlook-Events/Outlook-Item-Events/
>

>> My motive is to display attachments when select a item and delete them
> > when select another item. And this all should not modify on exchange
> > server.
> > It it not possible?

>
 
K

Ken Slovak - [MVP - Outlook]

Take a look at the Redemption oriented discussion at

http://www.devnewsgroups.net/group/microsoft.public.office.developer.outlook.vba/topic37406.aspx

for information about using that property.

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

news:eFSE2MGLKHA.4432@TK2MSFTNGP05.phx.gbl...
> oh. It means i need to change my design again. To complete my task there
> is one more way. I am adding an empty attachment to a mail on exchange
> server using CDO. But when i see this mail in outlook/owa, i found
> attachment size is change. it's 4 bytes or 64 bytes or 128 bytes. Dont
> know why but outlook shows its size. I think if attachment size is 0 bytes
> then outlook will not display it in right pane. When i open this
> attachment in outlook it has no data. Can i hide this attachment? Means it
> should not display in right pane when i select this mail in active
> explorer. Using CDO when i add this attachment on exchange server i did
> not find any way to hide it. So i try in outlook. I'm using following code
> to hide it in outlook. Code execute when click on a mail(which has empty
> attachment) in active explorer.

> Suppose mail item has one empty attachment

> LPMESSAGE lpMessage = (IMessage*)(IUnknown*)
> mailitem->Attachments->Item(1)->MAPIOBJECT;

> SPropValue pProp;
> pProp.ulPropTag = PR_ATTACHMENT_HIDDEN;
> pProp.Value.b = true;

> HRESULT hr = HrSetOneProp(lpMessage, &pProp);
> if(hr == S_OK)
> lpMessage->SaveChanges(FORCE_SAVE);

> Also i have tried to change other properties like PR_ATTACH_METHOD,
> PR_ATTACH_FILE_NAME etc. but nothing happed. I have tried not to use
> SaveChanges method but no result.
 
A

Ashish

Thanks it's the example to use extended mapi in outlook addin which ask to

save mail and attachment after setting property.

Is there any example to set this property using CDO? I tried but could not

get succeed.
<kenslovak@mvps.org> wrote in message

news:OmcVl0JLKHA.4376@TK2MSFTNGP03.phx.gbl...
> Take a look at the Redemption oriented discussion at
> http://www.devnewsgroups.net/group/microsoft.public.office.developer.outlook.vba/topic37406.aspx
> for information about using that property.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:eFSE2MGLKHA.4432@TK2MSFTNGP05.phx.gbl...
> > oh. It means i need to change my design again. To complete my task there
> > is one more way. I am adding an empty attachment to a mail on exchange
> > server using CDO. But when i see this mail in outlook/owa, i found
> > attachment size is change. it's 4 bytes or 64 bytes or 128 bytes. Dont
> > know why but outlook shows its size. I think if attachment size is 0
> > bytes then outlook will not display it in right pane. When i open this
> > attachment in outlook it has no data. Can i hide this attachment? Means
> > it should not display in right pane when i select this mail in active
> > explorer. Using CDO when i add this attachment on exchange server i did
> > not find any way to hide it. So i try in outlook. I'm using following
> > code to hide it in outlook. Code execute when click on a mail(which has
> > empty attachment) in active explorer.
>

>> Suppose mail item has one empty attachment
>

>> LPMESSAGE lpMessage = (IMessage*)(IUnknown*)
> > mailitem->Attachments->Item(1)->MAPIOBJECT;
>

>> SPropValue pProp;
> > pProp.ulPropTag = PR_ATTACHMENT_HIDDEN;
> > pProp.Value.b = true;
>

>> HRESULT hr = HrSetOneProp(lpMessage, &pProp);
> > if(hr == S_OK)
> > lpMessage->SaveChanges(FORCE_SAVE);
>

>> Also i have tried to change other properties like PR_ATTACH_METHOD,
> > PR_ATTACH_FILE_NAME etc. but nothing happed. I have tried not to use
> > SaveChanges method but no result.

>
 
K

Ken Slovak - [MVP - Outlook]

I have no idea about any examples using CDO, you can google and see if you

can find anything and you can check at www.cdolive.com and see if anything's

there. If there are any I'd imagine they'd be in VB and not in C++.

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

news:OiwZsPKLKHA.5732@TK2MSFTNGP03.phx.gbl...
> Thanks it's the example to use extended mapi in outlook addin which ask to
> save mail and attachment after setting property.
> Is there any example to set this property using CDO? I tried but could not
> get succeed.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P Automate Outlook Start - No Active Explorer Object Found Using Outlook 10
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
S Active Directory Management Tools for Administrators Using Outlook 0
G Problems with Active Directory Rights Management Services (AD RMS) in Outlook 2013 Exchange Server Administration 0
Diane Poremsky Import Images into the Active Directory Using Outlook 0
S How to send an OUTLOOK task to a contact out of my active directory? Using Outlook 2
E Outlook rule only active certain times of day Using Outlook 6
R HELP!!! Email template with active excel spreadsheet Using Outlook 1
C active/passive broadband connections to maintain various IT services Exchange Server Administration 2
R Went from outlook 2003 to 2010 - can't retrieve active for contacts Using Outlook 0
C Active Directory does not exist or cannot be contacted Exchange Server Administration 12
T Exchange 2010 servers can't communicate with Active Directory Exchange Server Administration 4
L VBA Processing of Active E-Mail Message Outlook VBA and Custom Forms 2
A active inspector in memory Outlook VBA and Custom Forms 1
M How to get active inspector window handle? Outlook VBA and Custom Forms 3
A disable a menu in active inspector Outlook VBA and Custom Forms 1
K Working with Explorer.Close event Outlook VBA and Custom Forms 3
R Quick Access view in File Explorer when saving attachments Using Outlook 0
R Sending emails via Outlook XP, from Windows 10 File Explorer Using Outlook 1
K Macro Not Executing then send email from Explorer Outlook VBA and Custom Forms 3
I Windows 10 - .msg files on disk show Explorer popup error Using Outlook 5
M Question: Is there a rule that will save email in Windows Explorer Outlook VBA and Custom Forms 3
oliv- How to select an mailitem in explorer with "show as conversation" Outlook VBA and Custom Forms 8
Michael Chiasson PST file shows 300+MB in Windows Explorer, but only 250kb in Outlook 2010 Using Outlook 1
P Was Helvetica crashing Outlook, now fix has messed up explorer Using Outlook 4
R Outlook 2007 - drag drop email to Explorer Using Outlook 1
A vb6 run time error 5 when Outlook 2007 Explorer object displayed Outlook VBA and Custom Forms 1
C Create a Ribbon for the OL2010 Explorer Outlook VBA and Custom Forms 1
E Can I hide an explorer or make an explorer modal Outlook VBA and Custom Forms 2
E Can I hide an explorer or make an explorer modal Outlook VBA and Custom Forms 2
S How to italicize the email entry in explorer window Outlook VBA and Custom Forms 3
T Creating toolbar in new Explorer Outlook VBA and Custom Forms 3
S Strange Behaviour of Explorer Object. Outlook VBA and Custom Forms 1
T Is Explorer.FolderSwitch the best event for hiding commandbarbutton? Outlook VBA and Custom Forms 5
R destroying Explorer object pointers on shutdown Outlook VBA and Custom Forms 2
U Not able to delete Add-in button from multiple Outlook Explorer Outlook VBA and Custom Forms 1
Commodore Safe way to add or update holidays; Windows Notifications issue Using Outlook 8
e_a_g_l_e_p_i Gmail in Outlook 2010 preview issue Using Outlook 4
M Issue transferring Outlook 2016 email accounts & settings onto new computer Using Outlook 8
P Forwarding emails issue with special characters replacing text body Using Outlook 1
S Excel VBA and shared calendar issue Outlook VBA and Custom Forms 3
A Clipboard Resize Issue Using Outlook 7
J O365 - Adding Shared Google Calendar ICS link issue in O365 Using Outlook 0
P Outlook 2013 "Item could not be moved - still an issue for Outlook 2013 Using Outlook 0
E Mail sorting view issue Using Outlook 1
D hide messege issue Using Outlook 1
B Outllok 2007 License Expired issue Using Outlook 0
ManaarZakaria I'm afraid of this issue, cause of strange error Exchange Server Administration 2
e_a_g_l_e_p_i Another reinstall of Outlook 2010 issue Using Outlook 10
Justo Horrillo Issue with rules in Outlook 2010 Using Outlook 4

Similar threads

Top