Re: Fake a .Sent



private Outlook.Items mSentItems; //make it a class variable to make sure it
does not get collected
....
{
mSentItems =
Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderSentMail).Items;
mSentItems.ItemAdd += ItemAddHandler;
}

void ItemAddHandler(object Item)
{
//
}

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"DG" <DG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:82C65F04-4C88-4FFF-9F40-A14652317E1F@xxxxxxxxxxxxxxxx
Dmitry, if I understand your past messages I have read throughout all the
other message boards correctly, I need to use MAPIFolder.Items.ItemAdd as
an
event to the "Sent" folder. So as an e-mail is dropped to the Sent folder,
ItemAdd is called which leads to my call. What I can't figure out is if
it's
even possible to catch this event using VSTO / VB.Net? In all your
examples
with Sue Mosher, it's only VBA. Your thoughts?

Thanks Dmitry, as always, I owe you!

DG

"Dmitry Streblechenko" wrote:

Yes, the entry ids will change when the item is moved to the Outbox
first,
then again when it is moved to the Sent Items folder.
You will be better off using the ItemAdd event on the Sent Items folder
contents table (Items collection).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"DG" <DG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3A929421-D238-4AB5-9210-0CC88F296723@xxxxxxxxxxxxxxxx
-1663827697
The Operation Failed

I first save the e-mail to Drafts folder and I capture the EntryID. If
I
understand you correctly, the newly Sent e-mail will have a different
EntryID
than the one I saved to Draft. Is this correct? Any better way? I don't
mind
using your method of RDO but it's a little more complex due to an older
version of Redemption.dll (prior to RDO) installed on each PC from a
different application. So I am trying to avoid it.


"Dmitry Streblechenko" wrote:

What is the number? After the message is sent and moved to the Sent
Items
folder, its entry id changes (unless you are using PST, but that's
just a
peculiarity of the PST provider).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"DG" <DG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8006B56C-491B-4F04-875C-35103CC241DB@xxxxxxxxxxxxxxxx
Suppose the message was already written and I just want the user to
select
a
button to perform some action and then a Send. So after a successful
send,
I
run the following:

Dim myOlApp As New Outlook.Application
Dim myFolder As Outlook.MAPIFolder
Dim myEntryID As String
Dim myStoreID As String
Dim myNewFolder As Outlook.MailItem

myFolder =
myOlApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail)
myEntryID = EID --I retrieved this before I sent and after I
saved
it
myStoreID = myFolder.StoreID
myNewFolder = myOlApp.Session.GetItemFromID(myEntryID,
myStoreID)
myNewFolder.Display()

So now my logic is to recapture the e-mail AFTER it's sent from the
Sent
Folder so that I can save the MSG file appropriately. However, I'm
getting
an
error (a neg. Hex error) on the GetItemFromID. Any ideas?

"Dmitry Streblechenko" wrote:

One possible workaround is to create a message a post item
(PostItem)
(it
is
always created in the sent state), then change its MessageClass
property
back to "IPM.Note". You would still need to delete (or change) the
PR_ICON_INDEX MAPI property to make sure the icon is right.
<plug> Redemption (url) below allows to set the RDOMail.Sent
property
before
the item is saved for the very first time (MAPI limitation)</plug>

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"DG" <DG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F40DE643-213E-4CE9-A102-45719D0C7368@xxxxxxxxxxxxxxxx
I need to Save an e-mail to a temp folder WITH the status of
MailIte.Sent =
True. However, the e-mail has not been sent yet. Confused yet?

If I should open that MSG file, I need it's property to be .Sent
=
True.

Is it possible to fake a .Sent property? Is there a work-around
to
this
odd
request?

Thanks,
DG











.


Quantcast