A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Runtime Error from Some Computers Sending Dates to Outlook Calenda



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old February 11th 08, 03:06 PM posted to microsoft.public.outlook.program_vba
Cherii
external usenet poster
 
Posts: 1
Default Runtime Error from Some Computers Sending Dates to Outlook Calenda

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?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft C++ Runtime error outlook.exe crashes ramdonly El CiD Outlook - General Queries 5 August 6th 07 03:18 PM
Printing in Outlook I get a Runtime Error 2012. Captainhelo Outlook - Installation 0 September 19th 06 03:38 PM
Outlook Runtime Error Lorna Outlook - General Queries 2 September 12th 06 09:40 AM
Runtime error 80004005 Creating Outlook.Application Dave Add-ins for Outlook 6 July 18th 06 11:18 PM
Runtime error in opening Outlook 2002 Ajay Bankoti Outlook - Installation 0 March 3rd 06 12:34 PM


All times are GMT +1. The time now is 11:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.