Solved

View other user's calendar

Posted on 2006-10-31
6
1,267 Views
Last Modified: 2009-07-29
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
Comment
Question by:mvidas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 17846792
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
 
LVL 35

Author Comment

by:mvidas
ID: 17846864
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
 
LVL 76

Expert Comment

by:David Lee
ID: 17846948
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 17847135
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
 
LVL 35

Author Comment

by:mvidas
ID: 17849177
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
 
LVL 76

Expert Comment

by:David Lee
ID: 17850348
You're welcome.  
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question