Thread: Counting days
View Single Post
  #2  
Old November 21st 06, 03:09 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Counting days

If you have spaces in your search scope you need to enclose the string in
single quotes:

Const strS1 As String = "'IJM Travel Calendar'"

The same would apply for the filter string.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


wrote in message
ps.com...

Thanks for the Help Ken

I have a run into a couple of problems trying this. I am using

Sub SearchCalendar()

Dim objSch As Outlook.Search
Dim rsts As Outlook.Results
Dim i As Integer
blnSearchComp = False
Const strF1 As String = "urn:schemas:calendar:location = 'Kish
Island'"

Const strS1 As String = "IJM Travel Calendar"
Set objSch = Application.AdvancedSearch(Scope:=strS1,
Filter:=strF1, SearchSubFolders:=False, Tag:="SubjectSearch")
While blnSearchComp = False
DoEvents
Wend
Set rsts = objSch.Results

MsgBox rsts.Count



End Sub
(straight out of the Online Help)

I end up with an error in the set objSch line which I assume is the way
the strF1 string has been set, is there anything there that ive messed
up???

secondly , I can this will work fine for counting the number of events
that meet the search but where I have events running multiple days will
it not just report this as 1 event not duration??

Once again your help is appreciated

Cheers

Ian


Ads