Setting a MAPI property of type PT_SYSTIME

Status
Not open for further replies.
T

Tobias Böhm

Hello,

I'm trying to set the MAPI property PR_MESSAGE_DELIVERY_TIME of a

PostItem because I can't manage to set the "Received Date" on the

Outlook-Object. So I create the PostItem item, get a MapiItem from

that, close the initial PostItem (I heard it would reset any dates

when the item is still open) and set the property.

But I can't manage to set a proper date. The line looks like that:

mapiItem.SetProperty(0x0E060040, dateTimeValue);

I tried passing the DateTime object, a date/time string in various

formats but every time some date gets set that's either way in the

future (01.01.3702) or way in the past (01.01.1601).

Any hints on how to set the date properly?

Thanks,

Tobias

(I posted the same question on the board of the add-in framework I use

http://www.add-in-express.com/forum/read.php?FID=5&TID=5919 but I

think it might be more suitable here)
 
I'd first ask some of the same questions that you were asked on the Add-In

Express forum that were never answered.

What version of Outlook and what is mapiItem? Is it an Outlook 2007

PropertyAccessor, an Extended MAPI object, a Redemption object or what?

If this was a Redemption RDOMail object (or the RDOPost item derived from

RDOMail) I have no problem changing PR_MESSAGE_DELIVERY_TIME like this (VBA

code):

oMail.Fields(PR_MESSAGE_DELIVERY_TIME) = CDate("8/17/2009 11:00 AM")

"Tobias Böhm" <boehm.tobi@googlemail.com> wrote in message

news:72d9d6bd-09e9-4500-9627-e9a0005bf459@v36g2000yqv.googlegroups.com...
> Hello,

> I'm trying to set the MAPI property PR_MESSAGE_DELIVERY_TIME of a
> PostItem because I can't manage to set the "Received Date" on the
> Outlook-Object. So I create the PostItem item, get a MapiItem from
> that, close the initial PostItem (I heard it would reset any dates
> when the item is still open) and set the property.

> But I can't manage to set a proper date. The line looks like that:
> mapiItem.SetProperty(0x0E060040, dateTimeValue);

> I tried passing the DateTime object, a date/time string in various
> formats but every time some date gets set that's either way in the
> future (01.01.3702) or way in the past (01.01.1601).

> Any hints on how to set the date properly?

> Thanks,
> Tobias

> (I posted the same question on the board of the add-in framework I use
> http://www.add-in-express.com/forum/read.php?FID=5&TID=5919 but I
> think it might be more suitable here)
 
Hi Tobias,

This is how I set the time using extended mapi

Outlook::_NameSpacePtr spNameSpace = sp->GetSession();

IUnknownPtr pUnk = sp->GetMAPIOBJECT();

CComQIPtr<IMessage, &IID_IMessage> spMessage(pUnk);

long lUTC = 0L;

time(&lUTC);

SPropValue prop;

UnixTimeToFileTime(lUTC, &(prop.Value.ft));

prop.ulPropTag = PR_MESSAGE_DELIVERY_TIME;

hr = HrSetOneProp((LPMAPIPROP)(IUnknown*)spMessage, &prop );

Regards,

Tom

"Tobias Böhm" <boehm.tobi@googlemail.com> wrote in message

news:72d9d6bd-09e9-4500-9627-e9a0005bf459@v36g2000yqv.googlegroups.com...
> Hello,

> I'm trying to set the MAPI property PR_MESSAGE_DELIVERY_TIME of a
> PostItem because I can't manage to set the "Received Date" on the
> Outlook-Object. So I create the PostItem item, get a MapiItem from
> that, close the initial PostItem (I heard it would reset any dates
> when the item is still open) and set the property.

> But I can't manage to set a proper date. The line looks like that:
> mapiItem.SetProperty(0x0E060040, dateTimeValue);

> I tried passing the DateTime object, a date/time string in various
> formats but every time some date gets set that's either way in the
> future (01.01.3702) or way in the past (01.01.1601).

> Any hints on how to set the date properly?

> Thanks,
> Tobias

> (I posted the same question on the board of the add-in framework I use
> http://www.add-in-express.com/forum/read.php?FID=5&TID=5919 but I
> think it might be more suitable here)
 
On 19 Aug., 16:08, " - " <kenslo...@mvps.org
wrote:
> I'd first ask some of the same questions that you were asked on the Add-In
> Express forum that were never answered.

> What version of Outlook and what is mapiItem? Is it an Outlook 2007
> PropertyAccessor, an Extended MAPI object, a Redemption object or what?

> If this was a Redemption RDOMail object (or the RDOPost item derived from
> RDOMail) I have no problem changing PR_MESSAGE_DELIVERY_TIME like this (VBA
> code):

> oMail.Fields(PR_MESSAGE_DELIVERY_TIME) = CDate("8/17/2009 11:00 AM")

> >

> http://www.slovaktech.com

> "Tobias Böhm" <boehm.t...@googlemail.com> wrote in message

> news:72d9d6bd-09e9-4500-9627-e9a0005bf459@v36g2000yqv.googlegroups.com...
>
> > Hello,

>
> > I'm trying to set the MAPI property PR_MESSAGE_DELIVERY_TIME of a
> > PostItem because I can't manage to set the "Received Date" on the
> > Outlook-Object. So I create the PostItem item, get a MapiItem from
> > that, close the initial PostItem (I heard it would reset any dates
> > when the item is still open) and set the property.

>
> > But I can't manage to set a proper date. The line looks like that:
> > mapiItem.SetProperty(0x0E060040, dateTimeValue);

>
> > I tried passing the DateTime object, a date/time string in various
> > formats but every time some date gets set that's either way in the
> > future (01.01.3702) or way in the past (01.01.1601).

>
> > Any hints on how to set the date properly?

>
> > Thanks,
> > Tobias

>
> > (I posted the same question on the board of the add-in framework I use
> >http://www.add-in-express.com/forum/read.php?FID=5&TID=5919but I
> > think it might be more suitable here)


Well, sorry, both your messages are new to me.

It is Outlook 2003 & 2007 and I'm using Extended MAPI.
 
If you're using Extended MAPI then see Tom's answer, that should work.

"Tobias Böhm" <boehm.tobi@googlemail.com> wrote in message

news:93188d37-e728-45d1-8726-aeb2527e9382@v36g2000yqv.googlegroups.com...

<snip
Well, sorry, both your messages are new to me.

It is Outlook 2003 & 2007 and I'm using Extended MAPI.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
V Setting up Outlook 2021 on new computer Using Outlook 2
AlphonseG Outlook 365 Outlook Crashes on setting SaveSentMessageFolder Outlook VBA and Custom Forms 4
R Outlook 2021 Having problem setting up outlook 2021 with windows 11. I have 3 gmail accounts and I want the 3 gmail, emails to merge into the same outlook input. Using Outlook.com accounts in Outlook 0
e_a_g_l_e_p_i Outlook 2010 Help setting up Gmail account in Outlook 2010 Using Outlook 3
P OWA Settings->Calendar->Events from Email; Setting changes do not hold Using Outlook 1
Marc2019 Setting up an Outlook Account on Mac Os 10.6.8 Outlook 2011 Using Outlook 1
L Outlook Office 365 client: won't remember my setting File, not to collapse ribbon Using Outlook 2
M Where is the setting to *turn off* open calendar in a new window? Using Outlook 3
llama_thumper Setting up forwarders on Exchange server Exchange Server Administration 0
B Setting rules Using Outlook 1
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
B Setting defaults Using Outlook 2
C need help setting up outlook first time Using Outlook 1
P Reading Pane (Reading Pain?) Default Setting Using Outlook 1
W Setting up a custom form Outlook VBA and Custom Forms 2
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
R Setting font and color used when replying to an email Outlook VBA and Custom Forms 3
M Setting flag follow up for next business day Outlook VBA and Custom Forms 1
Ed Sheehan Unusual behaviour in setting Sender (Outlook 2016) Outlook VBA and Custom Forms 4
Jennifer Murphy Equations don't comply with style setting to left justify Using Outlook 0
J Setting default address book Using Outlook 0
N Does a Shared Folder Policy override a Digital Signature Setting for macros? Outlook VBA and Custom Forms 6
Diane Poremsky Setting up an Outlook.com IMAP account Using Outlook 0
Diane Poremsky Setting the default Country for Outlook Contacts Using Outlook 0
H Need help setting up GetFolderPath-Makro with Vodafone IMAP Mail-Account Outlook VBA and Custom Forms 0
Diane Poremsky Adjusting Outlook's Zoom setting in Email Using Outlook 0
O Setting default format for composing/replying to emails Using Outlook 3
B Outlook Calendar/setting appointments Using Outlook 1
Diane Poremsky Adjusting Outlook's Zoom setting in Email Using Outlook 0
Diane Poremsky Setting Custom Reminder Times Using Outlook 0
A Can't stop Outlook.com from setting reminders on appointments? Using Outlook.com accounts in Outlook 3
A Setting RULES with more than one condition in MS OUTLOOK Using Outlook 6
L Setting up my PA's Outlook Using Outlook 7
E Need Help on Setting up a repeated Reminder on Task with Reoccurence Every Year Using Outlook 6
N "Instant Search" setting a default view Using Outlook 3
H SETTING UP A "NEW" NEVER HAD NEVER USED EMAIL ACCOUNT Using Outlook 9
K Setting Default Email Address for Meeting Replies Using Outlook 3
S Setting up Outlook 2010 to work with custom domain outlook.com account BCM (Business Contact Manager) 3
D Setting defult "Show a room list" Using Outlook 0
Horsepower Setting appointments in calendar Using Outlook 3
J Setting tabs in contacts / notes field Using Outlook 0
T Setting a Default Subject from a certain Signature Using Outlook 0
K Help Needed - setting up Email in Outlook 2013 Using Outlook 3
mikecox setting Default area code in Contacts Using Outlook 5
G Outlook2013 - "From" name doesn't change even when changed in Account Setting Using Outlook 4
D How do I start completely from scratch in setting up Outlook 2013? Using Outlook 6
V View zoom setting changing Using Outlook 1
C Setting up Outlook 10 on Widows 8 using Google Server Using Outlook 3
I Outlook Appointments - Setting default text in message body Using Outlook 3
T Setting Color codes for each user of a shared Calendar Using Outlook 1

Similar threads

Back
Top