D
d. motsiff
hey all --
Im playing with some code samples found at slipstick.com and/or
outlookcode.com -- I forget -- but the find method with [subject] is
not working at all for me. If I walk through all my Calendar items
i can see this appointment in there, no problems, but when i try to
use find to get at it, no dice. won't come back.
I'm obviously missing something *VERY* easy and simple.... ...but
hrrrmpf! I know Im going to kick myself, but I've been squinting at
it for hours now. Can anyone take a peek and see why the following
code doesnt work?
Thanks,
D
--------------------------------------------
'call [subject] find function with a VALID, LEGIT, PRE-TESTED appt
subject!
DebugPrintCalendarItem("DR. HEARST - BLOOD WORK ON J NASH")
---------------------------------------------
Public Sub DebugPrintCalendarItem(ByVal inSubject As String)
'Print Calendar items with the [subject] string "inSubject" passed
in
Dim olApp As Outlook.Application
Dim nspNameSpace As Outlook.Namespace
Dim oCalItems As Items
Dim oCalFoundItems As Object
Dim oItem As Object
Dim fndStr As String
' Get references to the Outlook Contacts folder.
Set olApp = New Outlook.Application
Set nspNameSpace = olApp.GetNamespace("MAPI")
Set oCalItems = nspNameSpace.GetDefaultFolder(olFolderCalendar).Items
' build the search string
fndStr = "[subject]= " & Quote(inSubject)
Debug.Print (fndStr) ' [subject]= "DR. HEARST - BLOOD WORK ON J
NASH"
Set oCalFoundItems = oCalItems.Find(fndStr)
On Error Resume Next
For Each oItem In oCalFoundItems
Debug.Print (oItem.Subject & "~" & oItem.Body & "~" & _
oItem.Start & "~" & oItem.EntryID)
Next
End Sub
Im playing with some code samples found at slipstick.com and/or
outlookcode.com -- I forget -- but the find method with [subject] is
not working at all for me. If I walk through all my Calendar items
i can see this appointment in there, no problems, but when i try to
use find to get at it, no dice. won't come back.
I'm obviously missing something *VERY* easy and simple.... ...but
hrrrmpf! I know Im going to kick myself, but I've been squinting at
it for hours now. Can anyone take a peek and see why the following
code doesnt work?
Thanks,
D
--------------------------------------------
'call [subject] find function with a VALID, LEGIT, PRE-TESTED appt
subject!
DebugPrintCalendarItem("DR. HEARST - BLOOD WORK ON J NASH")
---------------------------------------------
Public Sub DebugPrintCalendarItem(ByVal inSubject As String)
'Print Calendar items with the [subject] string "inSubject" passed
in
Dim olApp As Outlook.Application
Dim nspNameSpace As Outlook.Namespace
Dim oCalItems As Items
Dim oCalFoundItems As Object
Dim oItem As Object
Dim fndStr As String
' Get references to the Outlook Contacts folder.
Set olApp = New Outlook.Application
Set nspNameSpace = olApp.GetNamespace("MAPI")
Set oCalItems = nspNameSpace.GetDefaultFolder(olFolderCalendar).Items
' build the search string
fndStr = "[subject]= " & Quote(inSubject)
Debug.Print (fndStr) ' [subject]= "DR. HEARST - BLOOD WORK ON J
NASH"
Set oCalFoundItems = oCalItems.Find(fndStr)
On Error Resume Next
For Each oItem In oCalFoundItems
Debug.Print (oItem.Subject & "~" & oItem.Body & "~" & _
oItem.Start & "~" & oItem.EntryID)
Next
End Sub