Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email from Lotus using Access Error

Status
Not open for further replies.

Thenolos

Technical User
Jul 15, 2004
38
Hey guys... Having a bit of a frustrating problem. I seem to be randomly getting an error when I click the command button to send an email. This is what it says:

"This action cannot be completed because the ARC Bankruptcy - Inbox - Lotus Notes application (ARC Bankruptcy - Inbox - Lotus Notes) is not responding. Choose 'Switch To' to activate ARC...."

The error box is not big enough to view the whole message. Critical options are "Switch To...", "Retry", and "Cancel", although cancel is not enabled.

This is the code I am using.

Code:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

 
    Dim nSession As Object
    Dim CurrentUser As String
    Dim DataBaseName As String
    Dim nDatabase As Object
    Dim nMailDoc As Object
    Dim nSendTo(60) As String    'array for 60 e-mail address
    Dim EmbeddedObj As Object
    Dim Attach1 As String
    Dim Attach2 As String
    Dim AttachME As Object
    Dim Recipient As String
    
    
Set nSession = CreateObject("Notes.NotesSession")
CurrentUser = nSession.UserName
DataBaseName = Left$(CurrentUser, 1) & Right$(CurrentUser, (Len(CurrentUser) - InStr(1, CurrentUser, " "))) & ".nsf"
    
Set nDatabase = nSession.GETDATABASE("", DataBaseName)
Call nDatabase.OPENMAIL

Attach1 = "S:\Arc\1.pdf"
Attach2 = "S:\Arc\2.pdf"
    
Set nMailDoc = nDatabase.CREATEDOCUMENT
nSendTo(0) = "ARC Bankruptcy"


         
nMailDoc.Form = "Memo"
nMailDoc.Body = "body goes here"
nMailDoc.SendTo = nSendTo
nMailDoc.Subject = "Subject of e-mail"
             
Set AttachME = nMailDoc.CREATERICHTEXTITEM("attach1")
Set EmbeddedObj = AttachME.embedobject(1454, "attachment1", Attach1)
Set AttachME = nMailDoc.CREATERICHTEXTITEM("attach2")
Set EmbeddedObj = AttachME.embedobject(1454, "attachment2", Attach2)

nMailDoc.SEND 0, Recipient
           
    Set nDatabase = Nothing
    Set nMailDoc = Nothing
    Set AttachME = Nothing
    Set nSession = Nothing
    Set EmbeddedObj = Nothing

MsgBox "Confirmation e-mail has been sent.", 16, "Good Job."




Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click
    
End Sub

I'm using Access 97, and Lotus Notes R5 Release 5.0.12

It seems that this error happens randomly... sometimes it works just fine. Sometimes I can fix it just by clicking Lotus on the task bar and then clicking back over to access.... other times I have to reboot lotus completely... any ideas?
 
I know this won't help much, but if the code works sometimes - doesn't that mean the code is fine?. I think the code is either right or it's wrong.

But I'm certainly going to be watching this thread for someone with much more knowledge than me to weigh in. I have been using Access VB code to e-mail from Lotus Notes for a couple months with no problem.

Bob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top