How to read other users appointment items?

H

H

Hi,

for reporting reasons I need to read other users appointment items
from their calendars on an Exchange 2K Server. My code has to run on a
client. The users gave me the rights to read their calendars.
I need only appointment items of a special category (not coded in
example) and a time interval from mystartdate to myenddate.
The example at the end of this message shows what I'm doing now.
It lasts up to 5 Minutes to read a users calendar.

How can I get this information much faster? Which alternatives to mapi
to exists? Some code examples would be very fine.
Thank you.

Dim olApp As Outlook.Application
Dim olExplorers As Outlook.Explorers
Dim olExpl As Outlook.Explorer
Dim ns As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder

Set olApp = New Outlook.Application
Set ns = olApp.GetNamespace("MAPI")
Set myRecipient = ns.CreateRecipient(Account)
myRecipient.Resolve

Set olFolder = _
ns.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
For N = 1 To olFolder.Items.Count
Set olAppt = olFolder.Items(N)
With olAppt
If .Start <= mystartdate And .End >= myenddate Or _
mystartdate <= .Start And myenddate >= .Start Or _
mystartdate <= .End And myenddate >= .End Then
...
 
S

Sue Mosher [MVP]

You can use the Items.Restrict method to return a filtered Items collection
that meets your critgeria. See http://www.slipstick.com/dev/finddate.htm for
details on incorporating dates into the search string.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

> Hi,
> for reporting reasons I need to read other users appointment items
> from their calendars on an Exchange 2K Server. My code has to run on a
> client. The users gave me the rights to read their calendars.
> I need only appointment items of a special category (not coded in
> example) and a time interval from mystartdate to myenddate.
> The example at the end of this message shows what I'm doing now.
> It lasts up to 5 Minutes to read a users calendar.
> How can I get this information much faster? Which alternatives to mapi
> to exists? Some code examples would be very fine.
> Dim olApp As Outlook.Application
> Dim olExplorers As Outlook.Explorers
> Dim olExpl As Outlook.Explorer
> Dim ns As Outlook.NameSpace
> Dim olFolder As Outlook.MAPIFolder
> Set olApp = New Outlook.Application
> Set ns = olApp.GetNamespace("MAPI")
> Set myRecipient = ns.CreateRecipient(Account)
> Set olFolder = _
> ns.GetSharedDefaultFolder _
> (myRecipient, olFolderCalendar)
> For N = 1 To olFolder.Items.Count
> Set olAppt = olFolder.Items(N)
> With olAppt
> If .Start <= mystartdate And .End >= myenddate Or _
> mystartdate <= .Start And myenddate >= .Start Or _
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top