Outlook and recurrence items...

G

Guest

I'm trying to make my VB read my outlook Calendar, and show me my todays
tasks. The connection is no problem and I have a collection of items with all
my calendar items... The problem is to decide whitch of them are regarding
today's date? Normal calendar items have start and end date, and it's easy to
calculate theese items... (But I have to loop, one by one to check..) But the
Recurrence items have start and end the day it was created.. and if I have a
appointment whitch starts on 1. january, and ends 31. december, from 07:00 to
08:00 every monday and friday, and one other appointment each tuesday and
wednesday from 14:00 to 15:00... how do I manage to sort out this
appointments?? I want to get all apointments on 07.09.2004 or just type in a
date, and get mye selected items in a collection...

Is there any easy solution on this? Or is it really necesary to check each
object and calculate the recurrance if it hits the current search date...
 
J

John Wadie

What is the method you used to get the start and end date of the item? If
you're using ADO or WebDAV then the properties you should check are
urn:schemas:calendar:dtstart and urn:schemas:calendar:dtend, they'll tell
you the actual date of the item, not the date it was created. For a good
sample on retrieving calendar items take a look at

http://msdn.microsoft.com/library/en-us/wss/wss/_cdo_enabling_recurring_appo
intment_expansion.asp

Cheers,
John Wadie
 
G

Guest

The calendar is not connected to a user... it's among the public folders..

I'm accessing the objects using this code:

Set myOlApp = New Outlook.Application
Set MyNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolders = MyNameSpace.Folders
Set myFolder = myFolders.Item("Public Folders")
Set myFolder2 = myFolder.Folders.Item("All Public Folders")
Set myFolder3 = myFolder2.Folders.Item("Companyname")
Set myAlarmCal = myFolder3.Folders.Item("Calendar")

The tree-structure is:
---Public folders
---All Public Folders
---Companyname
---Calendar

I then make a object with all the calendar items from the Calendar folder:

myAlarmCal.Items.IncludeRecurrences = True
Set myApptItems = myAlarmCal.Items

the object MyApptItems then contains ALL the items in the Calendar... but if
I try to retrieve the calendar objects like this:

For Each myAppt In myApptItems
If myAppt.Start < Now And myAppt.End > Now Then
tekst = tekst & myAppt.Start & "-" & myAppt.End & " -->" &
myAppt.Subject & vbCrLf
End If
Next
MsgBox tekst

(I've made an "light" version of my problem.. but this soes not either
works...) The only way to have this routine to see the recurrence items is
if the object starts om this dag. (First occurence).. I would hope there was
a routine that gave true or false if I tested on a date...

Maybe like this:
if myappt.occurance(now)=true then :)

I'm not familiar with CDO... and i don't know if it works on exchange
server version 5.5, on NT-platform....
 
J

John Wadie

CDO for Exchange 2000 (CDOEX) will not work on Exchange 5.5. I guess you'd
better post your question to one of the Outlook or Exchange newsgroups.

Regards,
John Wadie
 

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