Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1276
  • Last Modified:

View other user's calendar

Hello,

Is there any way that I can programmatically access another user's calendar via VBA/VB?
Using outlook 2000 SR1 Corporate/Workgroup with an exchange server (dont know what version).

The only way I know how to do it currently is to create a new appointment and go to Attendee Availability.  I can see their calendar that way, so it is at least somewhat accessible to me.

I've tried using   .GetSharedDefaultFolder(vRecipient, olFolderCalendar)   and get an error "The operation failed."  The recipient does resolve without issue so I know that isn't it.

Is there another way to do this?

Matt
0
mvidas
Asked:
mvidas
  • 4
  • 2
1 Solution
 
David LeeCommented:
Hi, Matt.

It's been awhile since I did anything in Outlook 2000 and although I still have the software it's not in an Exchange environment.  I'm not sure I'll be of much help.  That said, I need to ask a couple of questions to get a complete picture of the situation.  Has the other user delegated access to their mailbox to you or are you an Exchange admin?  When you create an appointment and go to attendee availability do you see the details of their appointments or just see the time blocked off?

Cheers!
0
 
mvidasAuthor Commented:
The other users haven't delegated any access to me, probably why the GetSharedDefaultFolder didn't work. I could get access to it, I'm more wondering for fun if I can get it programmatically.
I'm not even positive of it being exchange, I just assume so as its a big company.  
In the attendee availability it looks just blocked off, but I can right-click it to see the actual details (not in a new inspector window, just a small pop-up).  I could post an example screenshot tomorrow if it would help.
I'm having a lot of fun exploring the outlook model, though definitely finding it's limits somewhat annoying.  With all the harm that could be done with code and email, I can see the purpose for most of it
0
 
David LeeCommented:
If you aren't an Exchange admin and they haven't explicitly given you permission to their mailbox, then GetSharedDefaultFolder won't work.  I'm surprised you get that little pop-up showing their appointment details when you right-click on an area of blocked-off time.  In Outlook 2003 users with no admin rights and no explicit permissions can't do that.  They just see the time blocked off.  As I said before though it's been awhile since I tinkered with 2000, so it must behave differently and I just didn't remember.  There may be a way to query the free & busy information directly.  Let me see what I can find on that topic.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
David LeeCommented:
Give this a shot.  I just tried it in Outlook 2003/Exchange 2003 and it worked okay.  Not sure about 2000.  The key to this is the FreeBusy method of the Recipient object.  It returns a string, one character for each interval of time asked for, showing if the user is busy.  I've set it here to an interval of one hour.  The method returns free/busy time for 30 days.  I don't see a way to change that.  You can ask for a simple list where 0 is free and any other value is not, or a detailed list (which is what I set this for) that shows the actual status during that interval of time.  

Function IsUserFree(strUser As String, datStart As Date, datTime As Date) As Boolean
    Dim olkAppointment As Outlook.AppointmentItem, _
        olkUser As Outlook.Recipient, _
        varStatus As Variant, _
        intStart As Integer
    intStart = Hour(datTime)
    Set olkAppointment = Application.CreateItem(olAppointmentItem)
    Set olkUser = olkAppointment.Recipients.Add(strUser)
    olkUser.Resolve
    varStatus = olkUser.FreeBusy(datStart, 60, True)
    If Mid(varStatus, intStart, 1) = "0" Then
        IsUserFree = True
    End If
    Set olkUser = Nothing
    Set olkAppointment = Nothing
End Function
 
Sub TestFB()
    Debug.Print IsUserFree("John.Doe@company.com", #11/2/2006#, #8:00:00 AM#)
End Sub
0
 
mvidasAuthor Commented:
Nice! I hadn't even seen the FreeBusy method, that should give me what I need!

After actually looking closer at my calendar, all it shows when I right-click is "tentative", "out of office", etc, which is returned by FreeBusy as well.  I guess I never really looked that closely at it :)

Thanks!! Enjoy your first 2k points this month
Matt
0
 
David LeeCommented:
You're welcome.  
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now