Access to Lotus Notes Email Attachment (1 Viewer)

Len Boorman

Back in gainfull employme
Local time
Today, 05:35
Joined
Mar 23, 2000
Messages
1,930
I wish to attach to an email a specified "Shortcut" such that recipients will be able to simply click the "attachment and the Access application will open.

I have searched the forum quite extensively but the perspiration has overtaken the inspiration so any assistance would be appreciated.

Below is the complete code that I am using

Private Sub Combo206_Click()

Maint_Sup_Close = Now()' Update a field
Dim Attachment As String
Dim MailDoc As Object
Dim AttachME As Object
Dim EmbedObj As Object

Dim s As Object
Dim db As Object
Dim doc As Object
Dim rtItem As Object
Dim Server As String, Database As String
Dim strError As String
Dim PI As String
Dim Description As String
Dim Work As String

Dim Email As String
Dim Docket As String

PI = Me.PI_No_1
Description = Me.Desc
Email = Me.Created_Email
Docket = Me.Docket_ID
Work = Me.Work_Required

Set s = CreateObject("Notes.notesSession")
Server = s.GETENVIRONMENTSTRING("MailServer", True)
Database = s.GETENVIRONMENTSTRING("MailFile", True)
Set db = s.GETDATABASE(Server, Database)

On Error GoTo ErrorLogon
'see if user is logged on
Set doc = db.CREATEDOCUMENT
On Error GoTo 0

doc.Form = "Memo"
doc.importance = "1" '(Where 1=Urgent, 2= Normal, 3= FYI)

'Send an e-mail to
doc.SENDTO = Email
doc.RETURNRECEIPT = "1"
doc.Subject = "Maintenance Request Closure"

Set rtItem = doc.CreateRichTextItem("Body")
Call rtItem.APPENDTEXT("Maintenance Request " & Docket & " for " & PI & " " & Description & " This request was created by yourself and has been Completed. Please confirm Completion")
Call rtItem.ADDNEWLINE(1)
Call rtItem.APPENDTEXT("")
Call rtItem.ADDNEWLINE(1)
Call rtItem.ADDNEWLINE(2)
Call rtItem.APPENDTEXT("Request Details were")
Call rtItem.ADDNEWLINE(2)
Call rtItem.ADDNEWLINE(3)
Call rtItem.APPENDTEXT(Work)
Call rtItem.ADDNEWLINE(3)

Works fine down to here

next line gives error 13 Type Mismatch

Set AttachME = doc.CreateRichTextItem.Add("file:\\absmanuf_server\absmanuv\MaintManag\Repository\Email_Cell_Mcs_Maint.mdb.lnk")
SetEmbedObj = AttachME.EmbedObject(1454, "", "\\absmanuf_server\absmanuv\MaintManag\Repository\Email_Cell_Mcs_Maint.mdb.lnk")




doc.SaveMessageOnSend = True
Call doc.Send(False)


Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing

MsgBox "Message Sent"



ErrorLogon:
If Err.Number = 7063 Then
MsgBox " You must first logon to Lotus Notes"
Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing
End If


End Sub


I am a bit out of my depth and would appreciate a guru correcting the error of my ways

Regards

Len
 

Joe8915

Registered User.
Local time
Yesterday, 22:35
Joined
Sep 9, 2002
Messages
820
Len, good luck with lotus notes. I have tried for a couple years and never got it to work. I think I went as far a setting up the criteria in lotus notes itself and it never work.

So bottom line, let me know if you it to work.
 

Len Boorman

Back in gainfull employme
Local time
Today, 05:35
Joined
Mar 23, 2000
Messages
1,930
Basic email is fine. Drags data from form smacks into email and it goes. Its the attachment bit that is the problem

Plan B is to build a facility to track how many days it was that first email was sent and if the recipient has not responded then a chaser email sent. No attachments so should not be a problem. Death by email could be the solution



L
 

Users who are viewing this thread

Top Bottom