Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Outlook find Method (http://www.outlookbanter.com/outlook-vba/47390-outlook-find-method.html)

Meex May 2nd 07 04:30 PM

Outlook find Method
 
Hi,

I use the Items.Find method to search for a certain item,
sometimes it happens that the mehtod returns something, but when
I try to call a method on the returned item, or try to read a
property I get an automatisation error, although the item is really
in the system. It's also not possible to catch the error, because the
returned items is not Nothing so this comparison with IS NOTHING
returns false, when I try IS NULL or = "", I get the automatisation
error?
What could be the cause, or how can I catch the error?

regards
Meex


Dmitry Streblechenko May 2nd 07 06:48 PM

Outlook find Method
 
What is your code?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Meex" wrote in message
ups.com...
Hi,

I use the Items.Find method to search for a certain item,
sometimes it happens that the mehtod returns something, but when
I try to call a method on the returned item, or try to read a
property I get an automatisation error, although the item is really
in the system. It's also not possible to catch the error, because the
returned items is not Nothing so this comparison with IS NOTHING
returns false, when I try IS NULL or = "", I get the automatisation
error?
What could be the cause, or how can I catch the error?

regards
Meex




Meex May 3rd 07 11:40 AM

Outlook find Method
 
Code:
For Each Data In et_act.Rows
'Suchen nach ob Termin bereits vorhanden
Set myAppointment = myFolderCal.Items.Find("[BillingInformation] =
'" & _
Data("VBELN") & "'")
'Termin nicht gefunden, neu erstellen
If myAppointment Is Nothing Then
Set myAppointment = m_olApp.CreateItem(olAppointmentItem)
Else 'Termin vorhanden
If Not myAppointment.IsRecurring Then 'ERROR OCCURES!!!
For i = 1 To myAppointment.Links.count
myAppointment.Links.Remove (1)
Next i
End If
End If
Next

regards
Meex



Dmitry Streblechenko May 3rd 07 06:54 PM

Outlook find Method
 
How do you dim myAppointment? What would TypeName(myAppointment) return?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Meex" wrote in message
oups.com...
Code:
For Each Data In et_act.Rows
'Suchen nach ob Termin bereits vorhanden
Set myAppointment = myFolderCal.Items.Find("[BillingInformation] =
'" & _
Data("VBELN") & "'")
'Termin nicht gefunden, neu erstellen
If myAppointment Is Nothing Then
Set myAppointment = m_olApp.CreateItem(olAppointmentItem)
Else 'Termin vorhanden
If Not myAppointment.IsRecurring Then 'ERROR OCCURES!!!
For i = 1 To myAppointment.Links.count
myAppointment.Links.Remove (1)
Next i
End If
End If
Next

regards
Meex





Meex May 4th 07 08:25 AM

Outlook find Method
 

Dim myAppointment As AppointmentItem

I'm sorry, but at the moment I have no reproducable case, so I'm not
able to run your mentioned statement

regards
Meex



All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com