Runtime Error from Some Computers Sending Dates to Outlook Calenda

C

Cherii

This is the error message:

run time error’ – 1665007607 (9CC20009)
There must be at least one distribution list in the To, cc, or Bcc Box
Debug Continue End Help

Here is the code I am using - it works on about half of the computers in my
office:

Dim olApp As Object
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objDummy As Outlook.MailItem
Dim objRecip As Outlook.Recipient
Dim objAppt As Outlook.AppointmentItem
Dim olApt As Object
Dim olNs As Object
Dim strMsg As String
Dim strName As String

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")

If Err.Number = 429 Then
Set olApp = CreateObject("Outlook.application")
End If

On Error GoTo 0

Set olNs = olApp.GetNamespace("MAPI")

If olApp.ActiveExplorer Is Nothing Then
olApp.Explorers.Add _
(olNs.GetDefaultFolder(9), 0).Activate
Else

If Me!AttyName = "John Doe" Then
strName = "Doe, John B"
GoTo ExportAppt
End If
If Me!AttyName = "Jane Doe" Then
strName = "Doe, Jane"
GoTo ExportAppt
End If

ExportAppt:

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objDummy = objApp.CreateItem(olMailItem)
Set objRecip = objDummy.Recipients.Add(strName)
objRecip.Resolve
If objRecip.Resolved Then
On Error Resume Next
Set objFolder = _
objNS.GetSharedDefaultFolder(objRecip, _
olFolderCalendar)
If Not objFolder Is Nothing Then
Set objAppt = objFolder.Items.Add
If Not objAppt Is Nothing Then
With objAppt
.Start = Me!HrgDate & " " & Me!HrgTime
.Subject = Me!Client & " - " & Me!TypeHrg
.Body = Me!CaseNumber & " " & Me!AttyName
If Not IsNull(Me!CaseNumber) Then .Body = Me!CaseNumber & " with
" & Me!AttyName
If Not IsNull(Me!TypeHrg) Then .Location = "Court"
.ReminderSet = True
.Save
.Close (olSave)
objAppt.Display
End With
End If
End If
Else

AttyNotListed:
MsgBox "Attorney's Calendar not found"
End If
End If

End Sub

There are about 50 AttyNames and associated e-mail addresses, but I reduced
it to two fake names for this posting.

Our database is Access 97, and we use Outlook 2003 on an exchange server.
The code works perfectly on most of the computers. I suspect it is a
date/time issue, but I can't narrow it down.

Any ideas or thoughts?
 

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