How to get AppointmentItem of Label "Business"

G

Guest

Newbie in Outlook objects trying to loop through all appointments in calendar
to extract appointment items with Label "Business". Please advise and any
sample code will be deeply appreciated. Thanks in advance!
 
G

Guest

Hi Michael, thanks for the reply. Is there some other way of achieving what I
have mentioned? Maybe via "Categories" instead. I just need to loop through
appointment items and extract appointment items of specific type i.e.
"Business", either indicated by "Label" or "Categories".

Thanks again!
 
M

Michael Bauer

Hi juzion,

yes, searching for categories would be another way. This loops through
your standard calendar and searches for "business" in the Appointment´s
categories:

Dim obj as Object
Dim oAppt as Outlook.AppointmentItem

For Each obj in
Application.Session.GetDefaultFolder(olFolderCalendar).Items
if TypeOf obj is Outlook.AppointmentItem Then
Set oAppt=obj
If Instr(oAppt.Categories, "business", vbTextCompare) Then
' match
Endif
Endif
Next
 

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