Outlook 2000 to 2002 Upgrade Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This Works in Outlook 2000 but not in 2002. Can anyone shed some light on a frustrating problem

Thanks
DS

Private Sub OutlookSearch(fFail As Boolean

Dim myOutlook As Outlook.Applicatio
Dim ns As Outlook.NameSpac
Dim itmEvents As Outlook.Item
Dim itmCount As Outlook.Item
Dim itmEvent As Outlook.AppointmentIte
Dim intResponse As Intege
Dim strMBoxTitle As Strin

strMBoxTitle = "HPI dB: Outlook Interface

Set myOutlook = New Outlook.Applicatio
Set ns = myOutlook.GetNamespace("MAPI"
Set itmEvents = ns.GetDefaultFolder(olFolderCalendar).Item
Set itmCount = itmEvents.Restrict("[EventID]=" & Me![txtEventID]

If itmCount.Count = 1 The
fFail = Fals
Set itmEvent = itmEvents.Find("[EventID]=" & Me![txtEventID]
itmEvent.Delet
ElseIf itmCount.Count > 1 The
fFail = Tru
intResponse = MsgBox("CAUTION: Multiple occurrences of this event have been found in the MS Outlook calendar!" & Chr(13) &
"Manual correction to the calendar is required.", vbCritical, strMBoxTitle
End I


Set myOutlook = Nothin
Set ns = Nothin
Set itmEvents = Nothin
Set itmCount = Nothin
Set itmEvent = Nothin

End Su
 
Where does it fail? Where is this code running?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Hello Sue,

Thanks for your response.

The program fails at the following line:

Set myOutlook = New Outlook.Application

This code is part of a MS Access form. As mentioned earlier, it worked
fine with OL2000. I attempted to upgrade to OL2002 (because of a recent
purchase of a Pocket PC) and the code fails. I then uninstalled OL2002
and reinstalled OL2000 and the problem persists.
 
Do you have a reference to the Microsoft Outlook 10.0 Object Library in the references for your project?

The newsgroup interface at Developersdex (http://www.developersdex.com) does not automatically quote the text of the original message when you post a reply. Please take the time to quote the original message manually so that people reading your current response can understand what you're talking about. Otherwise, you may not receive the answer you're looking for.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Hello Sue,

Thanks for the reply. The code fails on the line

Set myOutlook = New Outlook.Application

It is running in a MS Access 2000 form.

As I mentioned on my earlier post, my code has been
working great with OL2000. However, I recently needed to
upgrade to OL2002 (because of the installation of
ActiveSync for the Pocket PC) and the problem appeared. I
attempted to uninstall OL2002 and reinstall OL2000 to get
everything back to the way it was originally and found
that the problem still persists.

Any suggestions?

Thanks!

DSH
-----Original Message-----
Where does it fail? Where is this code running?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Daniel S Henneberry" <[email protected]> wrote in
message (e-mail address removed)...
This Works in Outlook 2000 but not in 2002. Can anyone shed some light on a frustrating problem?

Thanks,
DSH

Private Sub OutlookSearch(fFail As Boolean)

Dim myOutlook As Outlook.Application
Dim ns As Outlook.NameSpace
Dim itmEvents As Outlook.Items
Dim itmCount As Outlook.Items
Dim itmEvent As Outlook.AppointmentItem
Dim intResponse As Integer
Dim strMBoxTitle As String

strMBoxTitle = "HPI dB: Outlook Interface"

Set myOutlook = New Outlook.Application
Set ns = myOutlook.GetNamespace("MAPI")
Set itmEvents = ns.GetDefaultFolder (olFolderCalendar).Items
Set itmCount = itmEvents.Restrict("[EventID]=" & Me! [txtEventID])

If itmCount.Count = 1 Then
fFail = False
Set itmEvent = itmEvents.Find("[EventID]=" & Me! [txtEventID])
itmEvent.Delete
ElseIf itmCount.Count > 1 Then
fFail = True
intResponse = MsgBox("CAUTION: Multiple
occurrences of this event have been found in the MS
Outlook calendar!" & Chr(13) & _
 
Back
Top