Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

View other user's calendar

Posted on 2006-10-31
6
Medium Priority
?
1,271 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 76

Accepted Solution

by:
David Lee earned 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

722 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