drassigi
August 14th, 2001, 02:03 AM
Hi all,
I need to send mail with attachment with default mail client.. Ms Outlook or Lotus Notes.
I have to open composing window with attached file.
With Ms Outlook it is ease and there are no problems.
Here found some VB code for mail sending with Lotus Notes:
public Sub SendNotesMail(Subject as string, Attachment as string, Recipient as string, BodyText as string, SaveIt as Boolean)
'//set up the objects required for Automation into lotus notes
Dim Maildb as Object 'The mail database
Dim UserName as string 'The current users notes name
Dim MailDbName as string 'THe current users notes mail database name
Dim MailDoc as Object 'The mail document itself
Dim AttachME as Object 'The attachment richtextfile object
Dim Session as Object 'The notes session
Dim EmbedObj as Object 'The embedded object (Attachment)
'//Start a session to notes
set Session = CreateObject("Notes.NotesSession")
'//Open the mail database in notes
set Maildb = Session.getdatabase("", "")
If Maildb.ISOPEN = true then '//Already open for mail
else
Maildb.openmail
End If
'//set up the new mail document
set MailDoc = Maildb.createdocument
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
'//set up the embedded object and attachment and attach it
If Attachment <> "" then
set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
End If
'//Send the document
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.Send 0, Recipient
'//Clean Up
set Maildb = nothing
set MailDoc = nothing
set AttachME = nothing
set Session = nothing
set EmbedObj = nothing
End Sub
I know that I have to crete Notes.NotesUIWorkspace and Notes.NotesUIDocument object to make this MailDoc visible, but I couldnt.
Please help me to put this document in editing form.
S.
I need to send mail with attachment with default mail client.. Ms Outlook or Lotus Notes.
I have to open composing window with attached file.
With Ms Outlook it is ease and there are no problems.
Here found some VB code for mail sending with Lotus Notes:
public Sub SendNotesMail(Subject as string, Attachment as string, Recipient as string, BodyText as string, SaveIt as Boolean)
'//set up the objects required for Automation into lotus notes
Dim Maildb as Object 'The mail database
Dim UserName as string 'The current users notes name
Dim MailDbName as string 'THe current users notes mail database name
Dim MailDoc as Object 'The mail document itself
Dim AttachME as Object 'The attachment richtextfile object
Dim Session as Object 'The notes session
Dim EmbedObj as Object 'The embedded object (Attachment)
'//Start a session to notes
set Session = CreateObject("Notes.NotesSession")
'//Open the mail database in notes
set Maildb = Session.getdatabase("", "")
If Maildb.ISOPEN = true then '//Already open for mail
else
Maildb.openmail
End If
'//set up the new mail document
set MailDoc = Maildb.createdocument
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
'//set up the embedded object and attachment and attach it
If Attachment <> "" then
set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
End If
'//Send the document
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.Send 0, Recipient
'//Clean Up
set Maildb = nothing
set MailDoc = nothing
set AttachME = nothing
set Session = nothing
set EmbedObj = nothing
End Sub
I know that I have to crete Notes.NotesUIWorkspace and Notes.NotesUIDocument object to make this MailDoc visible, but I couldnt.
Please help me to put this document in editing form.
S.