About LastModificationTime on _AppointmentItem

Status
Not open for further replies.
M

MB34

I'm finding that when I read the LstModificationTime from some

_AppointmentItems, it is returning a timestamp from the FUTURE!

Now, when you update an item, does the LastModifiedTime get reset for

ALL items? I'm also finding that the same

value is being returned regardless of the item I check.

Any ideas?
 
That property is specific to each item. Modifying one item won't change the

property on any others.

How are you getting that property, what API are you using? What version of

Outlook? If you get the property using the Outlook object model it should be

correct for your local time, assuming the time zones are correctly set up in

both Windows and Outlook. If you read it using a MAPI API you are probably

getting the date/time value in UTC, not adjusted for local time. Inside the

hood that's how all Outlook dates/times are stored.

If you get the same value from every item then either every item was

actually modified at that time or you are doing something wrong.

"MB34" <mrbaseball34@hotmail.com> wrote in message

news:c439e414-9a9e-4f66-a4ec-9cc799713687@p18g2000pra.googlegroups.com...
> I'm finding that when I read the LstModificationTime from some
> _AppointmentItems, it is returning a timestamp from the FUTURE!

> Now, when you update an item, does the LastModifiedTime get reset for
> ALL items? I'm also finding that the same
> value is being returned regardless of the item I check.

> Any ideas?
 
On Jul 9, 12:24 pm, "
<kenslo...@mvps.org> wrote:
> That property is specific to each item. Modifying one item won't change the
> property on any others.

> How are you getting that property, what API are you using? What version of
> Outlook? If you get the property using the Outlook object model it should be
> correct for your local time, assuming the time zones are correctly set up in
> both Windows and Outlook. If you read it using a MAPI API you are probably
> getting the date/time value in UTC, not adjusted for local time. Inside the
> hood that's how all Outlook dates/times are stored.
>


I'm getting it like this using Delphi:

const

EmptyDispParams: TDispParams = (rgvarg: nil; rgdispidNamedArgs: nil;

cArgs: 0; cNamedArgs: 0);

var

iLCID: Integer;

function GetDispId(const Obj: IDispatch; const Member: WideString;

DispIdPtr: PInteger): Boolean;

begin

Result := Succeeded(Obj.GetIdsOfNames(GUID_NULL, @Member, 1, iLCID,

DispIdPtr));

end;

function InvokePropertyGet(const Obj: IDispatch; Name:

WideString):Variant;

var

intDispId, ArgErr: Integer;

DispParams: TDispParams;

begin

if GetDispId(Obj, Name, @intDispId) then

begin

DispParams := EmptyDispParams;

OleCheck(Obj.Invoke(intDispId,

GUID_NULL,

iLCID,

DISPATCH_PROPERTYGET,

DispParams,

// Using D6 so if you are trying on later

versions

// change this to just Result

@Result,

nil,

// Using D6 so if you are trying on later

versions

// change this to just ArgErr

@ArgErr));

end;

end;

And retrieving with this call:

// OutlookCompareFieldName is a parameter to the function where this

code lies and is

// set to 'LastModificationTime'

AApptCompareFieldValue := InvokePropertyGet(AOutlookAppointmentItem,

OutlookCompareFieldName);

If I inspect the AOutlookAppointmentItem, the LastModificationTime is

the same as the one retrieved using the call above.

The reason I'm doing it this way is so I can pass, by name, which

property I want to retrieve.


> If you get the same value from every item then either every item was
> actually modified at that time or you are doing something wrong.
>


That could not explain how the value returned was in the future. It

was a time stamp several minutes later

than the time on my system. My system time is not several minutes

behind the Exchange server time.



> "MB34" <mrbasebal...@hotmail.com> wrote in message

> news:c439e414-9a9e-4f66-a4ec-9cc799713687@p18g2000pra.googlegroups.com...
>
> > I'm finding that when I read the LstModificationTime from some
> > _AppointmentItems, it is returning a timestamp from the FUTURE!

>
> > Now, when you update an item, does the LastModifiedTime get reset for
> > ALL items? I'm also finding that the same
> > value is being returned regardless of the item I check.

>
> > Any ideas?
 
Seems our Exchange server was 10 minutes ahead of my system. That

would cause this problem. My system is not on the domain so

I do not get my time synced with the PDC like the Exchange server.

Setting my system time to the same as the Exchange server resolved

the problem I had
 
What do you see in OutlookSpy if you select the appointment in question and

click the Item button?

Dmitry Streblechenko (MVP)

-

"MB34" <mrbaseball34@hotmail.com> wrote in message

news:771e0000-b634-48d3-b9de-853b0744bc38@y17g2000yqn.googlegroups.com...
> On Jul 9, 12:24 pm, "> <kenslo...@mvps.org> wrote:
> > That property is specific to each item. Modifying one item won't change
> > the
> > property on any others.
>

>> How are you getting that property, what API are you using? What version
> > of
> > Outlook? If you get the property using the Outlook object model it should
> > be
> > correct for your local time, assuming the time zones are correctly set up
> > in
> > both Windows and Outlook. If you read it using a MAPI API you are
> > probably
> > getting the date/time value in UTC, not adjusted for local time. Inside
> > the
> > hood that's how all Outlook dates/times are stored.
> >


> I'm getting it like this using Delphi:

> const
> EmptyDispParams: TDispParams = (rgvarg: nil; rgdispidNamedArgs: nil;
> cArgs: 0; cNamedArgs: 0);

> var
> iLCID: Integer;

> function GetDispId(const Obj: IDispatch; const Member: WideString;
> DispIdPtr: PInteger): Boolean;
> begin
> Result := Succeeded(Obj.GetIdsOfNames(GUID_NULL, @Member, 1, iLCID,
> DispIdPtr));
> end;

> function InvokePropertyGet(const Obj: IDispatch; Name:
> WideString):Variant;
> var
> intDispId, ArgErr: Integer;
> DispParams: TDispParams;
> begin
> if GetDispId(Obj, Name, @intDispId) then
> begin
> DispParams := EmptyDispParams;
> OleCheck(Obj.Invoke(intDispId,
> GUID_NULL,
> iLCID,
> DISPATCH_PROPERTYGET,
> DispParams,
> // Using D6 so if you are trying on later
> versions
> // change this to just Result
> @Result,
> nil,
> // Using D6 so if you are trying on later
> versions
> // change this to just ArgErr
> @ArgErr));
> end;
> end;

> And retrieving with this call:
> // OutlookCompareFieldName is a parameter to the function where this
> code lies and is
> // set to 'LastModificationTime'
> AApptCompareFieldValue := InvokePropertyGet(AOutlookAppointmentItem,
> OutlookCompareFieldName);

> If I inspect the AOutlookAppointmentItem, the LastModificationTime is
> the same as the one retrieved using the call above.
> The reason I'm doing it this way is so I can pass, by name, which
> property I want to retrieve.
>
> > If you get the same value from every item then either every item was
> > actually modified at that time or you are doing something wrong.
> >


> That could not explain how the value returned was in the future. It
> was a time stamp several minutes later
> than the time on my system. My system time is not several minutes
> behind the Exchange server time.

>
>

>> "MB34" <mrbasebal...@hotmail.com> wrote in message
>

>> news:c439e414-9a9e-4f66-a4ec-9cc799713687@p18g2000pra.googlegroups.com...
> >
> > > I'm finding that when I read the LstModificationTime from some
> > > _AppointmentItems, it is returning a timestamp from the FUTURE!

> >
> > > Now, when you update an item, does the LastModifiedTime get reset for
> > > ALL items? I'm also finding that the same
> > > value is being returned regardless of the item I check.

> >
> > > Any ideas?

>
 
Status
Not open for further replies.
Back
Top