I am using the code below to connect to a Lotus Notes Client, but when it gets to the Initialize command the error message 'Can't find ID File' appears. I've tried with both with and without the password and the same error message appears.
Dim NotesSess As Object
Dim NotesDBase As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim Var As Variant
Dim flag As Boolean
Set NotesSess = CreateObject("Lotus.NotesSession"
Call NotesSess.Initialize(mvarPassword)
Set NotesDBase = NotesSess.GetDatabase(mvarMailServer, mvarMailFile)
flag = True
If Not (NotesDBase.IsOpen) Then
MsgBox "Can't open mail file: " & NotesDBase.Server & " " & NotesDBase.FilePath
GoTo exit_SendAttachment
End If
Set oDoc = NotesDBase.CreateDocument
Set oItem = oDoc.CreateRichTextItem("BODY"
Call oItem.AppendText(mvarBody & Chr(13) & Chr(13))
With oDoc
.ReplaceItemValue "SendTo", mvarSendTo
.ReplaceItemValue "CopyTo", mvarCCTo
.ReplaceItemValue "BlindCopyTo", vbNullString
.ReplaceItemValue "Subject", mvarSubject
.ReplaceItemValue "Body", mvarBody
End With
If mvarAttachments <> vbNullString Then
Do Until InStr(1, mvarAttachments, ";"
= 0
Call oItem.EmbedObject(1454, "", Mid(mvarAttachments, 1, (InStr(1, mvarAttachments, ";"
- 1)))
mvarAttachments = Mid(mvarAttachments, (InStr(1, mvarAttachments, ";"
+ 1))
Loop
Call oItem.EmbedObject(1454, "", mvarAttachments)
End If
oDoc.SaveMessageOnSend = True
oDoc.Send False
exit_SendAttachment:
On Error Resume Next
Set NotesSess = Nothing
Set NotesDBase = Nothing
Set oDoc = Nothing
Set oItem = Nothing
Dim NotesSess As Object
Dim NotesDBase As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim Var As Variant
Dim flag As Boolean
Set NotesSess = CreateObject("Lotus.NotesSession"
Call NotesSess.Initialize(mvarPassword)
Set NotesDBase = NotesSess.GetDatabase(mvarMailServer, mvarMailFile)
flag = True
If Not (NotesDBase.IsOpen) Then
MsgBox "Can't open mail file: " & NotesDBase.Server & " " & NotesDBase.FilePath
GoTo exit_SendAttachment
End If
Set oDoc = NotesDBase.CreateDocument
Set oItem = oDoc.CreateRichTextItem("BODY"
Call oItem.AppendText(mvarBody & Chr(13) & Chr(13))
With oDoc
.ReplaceItemValue "SendTo", mvarSendTo
.ReplaceItemValue "CopyTo", mvarCCTo
.ReplaceItemValue "BlindCopyTo", vbNullString
.ReplaceItemValue "Subject", mvarSubject
.ReplaceItemValue "Body", mvarBody
End With
If mvarAttachments <> vbNullString Then
Do Until InStr(1, mvarAttachments, ";"
Call oItem.EmbedObject(1454, "", Mid(mvarAttachments, 1, (InStr(1, mvarAttachments, ";"
mvarAttachments = Mid(mvarAttachments, (InStr(1, mvarAttachments, ";"
Loop
Call oItem.EmbedObject(1454, "", mvarAttachments)
End If
oDoc.SaveMessageOnSend = True
oDoc.Send False
exit_SendAttachment:
On Error Resume Next
Set NotesSess = Nothing
Set NotesDBase = Nothing
Set oDoc = Nothing
Set oItem = Nothing