none
free/busy status of the user for Meeting Request!! RRS feed

  • Question

  • I am creating an script that gives me the list of meeting rooms that are free at the specified time:

    Dim objOL
    Dim objAppt
    Const olAppointmentItem = 1
    Const olMeeting = 1
    Set objOL = CreateObject("Outlook.Application")
    Set objAppt = objOL.CreateItem(olAppointmentItem)
    objAppt.Subject = "My Test Appointment"
    objAppt.Start=("8/10/2012 07:10:00 PM")
    objAppt.End=("8/10/2012 07:20:00 PM")
    objAppt.Location = "Room 8"
    objAppt.MeetingStatus = olMeeting
    objAppt.RequiredAttendees = "vijaygupta@test.com"
    olBusystatus= objAppt.busystatus
    msgbox olbusystatus
    objAppt.Send
    Set objAppt = Nothing
    Set objOL = Nothing

    but I am getting olbusystatus as 2 always while my status is free at the specified time and I want to get my (recipient's of the Meeting Request) status at the specified time

    Am I doing something wrong?

    Vijay

    Tuesday, August 7, 2012 7:59 PM

Answers

  • this is only my musing on this topic - there was a time when outlook had grand plans - it was supposed to be a system in system so once user entered outlook he would not have to leave it to do anything outside. So maybe those Namespace objects were designed to provide access to different namespaces (groups of related functionality) in outlook, one for mail handling, one for files on disk, and so on and so on.
    Friday, August 10, 2012 11:06 AM

All replies

  • Of course AppointmentItem.BusyStatus will return olBusy - that is the default value for a new appointment: if you create an appoitment, that time slot will be busy, right?

    If you want to find the availability status, use Namespace.CreateRecipient, then call Recipient.FreeBusy


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, August 8, 2012 5:06 AM
  • I am using the below code as per your suggestion:

    Dim objOL   'As Outlook.Application
    Dim objAppt 'As Outlook.AppointmentItem
    Const olAppointmentItem = 1
    Const olMeeting = 1
    Set objOL = CreateObject("Outlook.Application")
    Set objNS=objOL.GetNameSpace("MAPI")
    Set myRecipient=objNS.CreateRecipient("vgupta@abcd.com")
    Set objAppt = objOL.CreateItem(olAppointmentItem)
    objAppt.Subject = "My Test Appointment"        
    objAppt.Start=("8/10/2012 01:10:00 AM")
    objAppt.End=("8/10/2012 01:20:00 AM")
    objAppt.Location = "Kashmir"
    msgbox myRecipient.freebusy(objappt.start,60*24)
    ' make it a meeting request
    objAppt.MeetingStatus = olMeeting
    objAppt.RequiredAttendees = "gurtrgrm03@spcapitaliq.com"
    objAppt.Send

    Set objNS=nothing

    Set objAppt = Nothing
    Set objOL = Nothing

    In this example, I am getting  28 character string for the statement myRecipient.freebusy(objappt.start,60*24,true)

    Shouldn't it give me 24 character string since there are only 24 days left in this month?


    Vijay

    http://learn2automate.wordpress.com
    • Edited by gupta vijay Wednesday, August 8, 2012 9:14 AM
    Wednesday, August 8, 2012 9:14 AM
  • documentation says about 'up to one month' of information, not a 'untill the end of calendar month'
    Wednesday, August 8, 2012 9:32 AM
  • Thanks Damien for the reply. So, can you please explain why it is giving 28 character string here and what duration does one character here represents?

    Vijay

    Wednesday, August 8, 2012 9:41 AM
  • DamianD,

    These links does not explain why it is giving 28 character string?


    Vijay

    Wednesday, August 8, 2012 11:25 AM
  • you set your setting to give you one character per day - apparently it decided that 28 days ahead fulfills 'up to one month' requirement.

    Wednesday, August 8, 2012 11:34 AM
  • How it is deciding that one month=28 days, that is the main issue?

    Vijay

    Wednesday, August 8, 2012 12:02 PM
  • why main issue? if it were 30 would that be better? you can always call freebusy again with new start time where previous returned period ends and so on, so i do not see a problem here.
    Wednesday, August 8, 2012 1:12 PM
  • Yes you are correct, however, I want to know why it is giving 28 days instead of 30/31?

    Which days is it missing?


    Vijay

    Wednesday, August 8, 2012 1:46 PM
  • Probably because 28 is the minimum number of days in a month possible (February). Or because 28 days is exactly 4 weeks.

    It really does not matter why - you cannot change it, so the question is how do you work aroudn that?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Wednesday, August 8, 2012 2:23 PM
  • Yes. I will workaround it.

    Can anyone please explain me the hierarchy of the Outlook object starting from Outlook?

    Mainly, what is the purpose of NameSpace and MAPI object?


    Vijay

    Thursday, August 9, 2012 6:44 PM
  • There is no MAPI object.

    Namespace object provides access to the MAPI related functionality: folders, messages, address book, etc.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, August 9, 2012 7:48 PM
  • Then, what is MAPI?

    Vijay

    Friday, August 10, 2012 5:24 AM
  • Messaging (or Mail) Application Programming Interface.

    Do you mean why you need to pass the string "MAPI" when calling Application.GetNamespace("MAPI") in OOM?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Friday, August 10, 2012 5:43 AM
  • Yes and can we create new namespeace in OOM?

    Vijay

    Friday, August 10, 2012 5:54 AM
  • No, you cannot create new namespaces. "MAPI" is the only supported parameter.

    Is this just out of curiosity or do you have a particular problem to solve?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Friday, August 10, 2012 6:12 AM
  • just out of curiosity...you mean to say mapi is the only namespace available to outlook?

    Also, please correct me if I am wrong..namespace is just the collcetion of similar libraries..Am I correct?


    Vijay

    Friday, August 10, 2012 9:44 AM
  • this is only my musing on this topic - there was a time when outlook had grand plans - it was supposed to be a system in system so once user entered outlook he would not have to leave it to do anything outside. So maybe those Namespace objects were designed to provide access to different namespaces (groups of related functionality) in outlook, one for mail handling, one for files on disk, and so on and so on.
    Friday, August 10, 2012 11:06 AM