Hi Guys,
I have a long macro that takes inputs from a worksheet and sends out multiple emails. Up to 11 sometimes. Here's the weird part, it sends out some emails, sometimes all, sometimes half. Random.
The error message is
RUN-TIME ERROR '7000'
NOTES ERROR

ATABASE ALREADY CONTAINS A DOCUMENT WITH THIS ID
(UNID)
Here is the section that sends the email, which the same code is repeated a few times.
Code:
Sub SendOmnibusEmail()
Dim oSess As Object
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim Var As Variant
Dim flag As Boolean
Dim sSetWbName As String
Set oSess = CreateObject("Notes.NotesSession")
Set oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL
flag = True
If Not (oDB.IsOpen) Then flag = oDB.Open("", "")
If Not flag Then
MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH
GoTo exit_SendAttachment
End If
' EMAIL ADDRESS FILES ARE SENT TO *************************************************
'Building Message
Set oDoc = oDB.CREATEDOCUMENT
Set oItem = oDoc.CREATERICHTEXTITEM("BODY")
oDoc.Form = "Memo"
oDoc.Subject = AccountName
oDoc.sendto = email
oDoc.body = OmnibusBody
oDoc.postdate = Date
oDoc.SaveMessageOnSend = True
oDoc.visable = True
'Sending Message
oDoc.SEND False
exit_SendAttachment:
On Error Resume Next
Set oSess = Nothing
Set oDB = Nothing
Set oDoc = Nothing
Set oItem = Nothing
oDoc.SEND True
End Sub
When I goto debug it goes to this line:
Any ideas as to the inconsistency??? Driving me nuts...
is it some variable that is not clearing before it repeates the lotus notes code?
thanks everyone is advance!!