Thanks for the answer, Ken.
I've tried dumping all the MAPI properties for a message both in my
Application::ItemSend handler (after saving the MailItem) and in my outbox
handler. Unfortunately I cannot see either of the properties you mention,
either by dumping the properties using my own code (see below for code
sample and dumped properties), or by using Outlook Spy on the message in the
outbox.
When I started working on this fix I expected to see both the properties you
specify (0x0E28001E and 0x0E29001E) and two others that would also be of use
(0x8032001E - account number and e-mail address and 0x8033001E - account
name). These are the four properties that the code I've inherited changes to
divert the mail to a different account.
FYI, I'm using Outlook 2002 SP-2 (10.4219.4219).
Thanks in advance
Matt Fletcher
The output I get from dumping all properties for a mail when it has arrived
in the outbox is as follows:
08:59:35:490 0000053C 03F4 Property: 0002000b = true
08:59:35:490 0000053C 03F4 Property: 00170003 = 0x00000001
08:59:35:490 0000053C 03F4 Property: 001a001e = 'IPM.Note'
08:59:35:490 0000053C 03F4 Property: 0023000b = false
08:59:35:490 0000053C 03F4 Property: 00260003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 0029000b = false
08:59:35:490 0000053C 03F4 Property: 00360003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 0037001e = 'Subject line'
08:59:35:490 0000053C 03F4 Property: 00390040 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0070001e = 'Subject line'
08:59:35:490 0000053C 03F4 Property: 00710102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e01000b = false
08:59:35:490 0000053C 03F4 Property: 0e04001e = 'Matt4
(
[email protected])'
08:59:35:490 0000053C 03F4 Property: 0e060040 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e070003 = 0x0000000c
08:59:35:490 0000053C 03F4 Property: 0e080003 = 0x000003d7
08:59:35:490 0000053C 03F4 Property: 0e0a0102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e140003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 0e1f000b = true
08:59:35:490 0000053C 03F4 Property: 1000001e = 'Message body
'
08:59:35:490 0000053C 03F4 Property: 10060003 = 0x5972bba0
08:59:35:490 0000053C 03F4 Property: 10070003 = 0x0000000b
08:59:35:490 0000053C 03F4 Property: 1008001e = 'MESSAGEBODY'
08:59:35:490 0000053C 03F4 Property: 10090102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 10100003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 10110003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 10800003 = 0xffffffff
08:59:35:490 0000053C 03F4 Property: 30070040 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 30080040 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 300b0102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 3fde0003 = 0x00004e9f
08:59:35:490 0000053C 03F4 Property: 59090003 = 0x00000001
08:59:35:490 0000053C 03F4 Property: 65400003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 8016000b = false
08:59:35:490 0000053C 03F4 Property: 80180003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 801e0003 = 0x0001971b
08:59:35:490 0000053C 03F4 Property: 802f0003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 80300040 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 8045001e = '10.0'
08:59:35:490 0000053C 03F4 Property: 8046000b = false
08:59:35:490 0000053C 03F4 Property: 804a000b = false
08:59:35:490 0000053C 03F4 Property: 804d0003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 8062000b = false
08:59:35:490 0000053C 03F4 Property: 003d001e = ''
08:59:35:490 0000053C 03F4 Property: 0e02001e = ''
08:59:35:490 0000053C 03F4 Property: 0e03001e = ''
08:59:35:490 0000053C 03F4 Property: 0e090102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e12000d (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e13000d (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0e1b000b = false
08:59:35:490 0000053C 03F4 Property: 0e1d001e = 'Subject line'
08:59:35:490 0000053C 03F4 Property: 0ff40003 = 0x00000002
08:59:35:490 0000053C 03F4 Property: 0ff70003 = 0x00000000
08:59:35:490 0000053C 03F4 Property: 0ff80102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0ff90102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0ffa0102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0ffb0102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 0ffe0003 = 0x00000005
08:59:35:490 0000053C 03F4 Property: 0fff0102 (value undetermined)
08:59:35:490 0000053C 03F4 Property: 340d0003 = 0x000237fd
08:59:35:490 0000053C 03F4 Property: 34140102 (value undetermined)
My C++ code (apologies, as I know you're a VB man) for dumping the
properties is as follows:
HRESULT CPropertyDump:
ump(CComPtr<IMAPIProp> spMapiProp, LPCTSTR
szObjectName)
{
LPSPropTagArray pta;
HRESULT hr = spMapiProp->GetPropList(0, &pta);
if (SUCCEEDED(hr))
{
ULONG ulCount = pta->cValues;
LPSPropValue ppv;
hr = spMapiProp->GetProps(pta, 0, &ulCount, &ppv);
if (SUCCEEDED(hr))
{
for (ULONG p = 0; p < ulCount; p++)
{
ULONG ulProperty = ppv[p].ulPropTag;
switch(ulProperty & 0xFFFF)
{
case PT_LONG:
SPTRACE("Property: %08x = 0x%08x\n",
ppv[p].ulPropTag,
ppv[p].Value.l);
break;
case PT_STRING8:
SPTRACE("Property: %08x = '%s'\n",
ppv[p].ulPropTag,
ppv[p].Value.lpszA);
break;
case PT_BOOLEAN:
SPTRACE("Property: %08x = %s\n",
ppv[p].ulPropTag,
(ppv[p].Value.b == 0) ? "false" : "true");
break;
default:
SPTRACE("Property: %08x (value undetermined)\n",
ppv[p].ulPropTag);
break;
}
}
::MAPIFreeBuffer(ppv);
}
MAPIFreeBuffer(pta);
}
return hr;
}