open appointment item - how to change time?

N

news.chello.at

Hello,
I want to change the time of an open appointment - like start time. From
15:30 to 16:30. But I don't know how I can refer to that field. Usually if
it is an form, I would take "me.starttime" or something like that. Or if I
walk through all appointment items in the whole calendar, the selected
appointment item is clear.
Can someone help me how I can refer to an opened and active appointment
item?
Thank you very much,
Erich
 
K

Ken Slovak

Use ActiveInspector.CurrentItem if the window is active. Otherwise iterate
the Inspectors collection and check CurrentItem for each open Inspector. You
can check the Class of the CurrentItem and expect back a value of
OlObjectClass.olAppointment if it is an appointment item. The property is
Start.
 
N

news.chello.at

Hello Ken,
thank you for your reply!
I tried to check out the "ActiveInspector.CurrentItem" - but this brought
not the correct results. There was an error occuring - "object does not
support method or attribute 438". Now I started just a macro with only this
content: "Debug.Print ActiveInspector.DefaultItemType" or "Debug.Print
OAI.OlObjectClass". Then the error appeared again.

With this code I can walk through all open inspectors and look which
captions there are:

For Each mInspector In myinspectors
Debug.Print mInspector.Caption
Next

But I can't find out which of the inspectors is the "active" one. So the
question for me is still, how I can figure out, what the open Appointment
(out of some) is?

Kind Regards,
Erich



"Ken Slovak" schrieb im Newsbeitrag

Use ActiveInspector.CurrentItem if the window is active. Otherwise iterate
the Inspectors collection and check CurrentItem for each open Inspector. You
can check the Class of the CurrentItem and expect back a value of
OlObjectClass.olAppointment if it is an appointment item. The property is
Start.
 
K

Ken Slovak

ActiveInspector would be null if no item window was opened or nothing was
active. If you activate an Inspector it should become ActiveInspector.

In any case, Inspector.CurrentItem.Class = olAppointment will tell you which
open windows hold appointments. If that test is true you have an
appointment.
 
N

news.chello.at

Hi Ken,
the problem is, that I have more than one open appointment. For example when
I open them out of the "outlook reminders".
Then I walk through all items - and every single item is an appointment. Now
I want to change the time from every item.
Kind regards,
Erich

"Ken Slovak" schrieb im Newsbeitrag

ActiveInspector would be null if no item window was opened or nothing was
active. If you activate an Inspector it should become ActiveInspector.

In any case, Inspector.CurrentItem.Class = olAppointment will tell you which
open windows hold appointments. If that test is true you have an
appointment.
 
N

news.chello.at

hi - ok, now I've got it...
.....
For Each mInspector In myinspectors
If mInspector = ActiveInspector Then
Debug.Print mInspector.Caption
End If
.....
Thank you!!




"Ken Slovak" schrieb im Newsbeitrag

ActiveInspector would be null if no item window was opened or nothing was
active. If you activate an Inspector it should become ActiveInspector.

In any case, Inspector.CurrentItem.Class = olAppointment will tell you which
open windows hold appointments. If that test is true you have an
appointment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top