How to get the owner of an appointmentitem

  • Thread starter Thread starter Hanspeter Gysel
  • Start date Start date
H

Hanspeter Gysel

Hi,
Im using Outlook 2002 and need a little help in a VBA-Macro I'm currently
working on.
The macro creates an assigned task for an appointment in the actual
inspector. To actually assign the task I need to set TaskItem.Recipients. I
want this to be the owner of the calendar the appointment is coming from.
Any idea how to get that information?
I tried to use AppointmentItem.Recipients, but it seems that field is only
populated after entering the schedule-a-meeting form of the appointment. Any
idea?

Thanks
Hanspeter Gysel
 
That is not working, since AppointmentItem.Organizer is like you said the
creator of the appointment. This is not necessarily the same person who owns
the calendar where the appointment resides.
I browsed throught tons of properties in the Object Browser and the
documentation but could not find anything that will solve my problem.

Any other idea?

Thanks so far
Hanspeter Gysel


Ken Slovak - said:
Try using AppointmentItem.Organizer, that gives you the name of the
creator of the appointment. When in doubt the Object Browser is your
friend.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Hanspeter Gysel said:
Hi,
Im using Outlook 2002 and need a little help in a VBA-Macro I'm currently
working on.
The macro creates an assigned task for an appointment in the actual
inspector. To actually assign the task I need to set TaskItem.Recipients. I
want this to be the owner of the calendar the appointment is coming from.
Any idea how to get that information?
I tried to use AppointmentItem.Recipients, but it seems that field is only
populated after entering the schedule-a-meeting form of the appointment. Any
idea?

Thanks
Hanspeter Gysel
 
Altought i didnt open the folder from my macro, I guess it's the same as if
I opened the Calendar with GetSharedDefaultFolder. Sorry, I didnt describe
that more clear from the beginning on.

Unfortunately your answer brings my little project to an abrupt stop. I
didnt plan to write an add-in at all and im not really familiar with MAPI.

Thanks anyway
Hanspeter Gysel



Ken Slovak - said:
Oh, you are referring to a folder opened using GetSharedDefaultFolder
or one opened from File, Open? That's completely different. The only
way to get the mailbox owner name in that case would be to use
Extended MAPI (C++ or Delphi only) to get the PR_MAILBOX_OWNER_NAME
property of the MsgStore for that folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Hanspeter Gysel said:
I played around with the parent-property, unfortunately with no luck.

I got the following results:
? objAppointmentItem.Parent = "Kalender"
? objAppointmentItem.Parent.Parent = "" !!!!!!?
? objAppointmentItem.Parent.Parent.Parent = "Mapi"
? objAppointmentItem.Parent.Parent.Parent.Parent = "Outlook"

I browsed throught lots of properties in the watch-window and was not able
to find any trace of the user that owns the calendar.
What you suggested works perfectly for Items in my own calendar. There I get
the expected objAppointmentItem.Parent.Parent="Mailbox - Username". For all
the other calendars I get the results described above.

Regards
Hanspeter Gysel
 
Back
Top