Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending Email using Lotus Notes

Hello,

Can anybody give me an idea or tips on how to create a VBA
or macro code sending an email using Lotus Notes R5.

I would appreciate very much your help.

Thanks
Bob

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Sending Email using Lotus Notes

Bob,
I posted this in mid June - hope it helps

Sub Send_ETCMail()

Dim oSess As Object, msg As String
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim var As Variant
Dim flag As Boolean

On Error GoTo Error1
Set oSess = CreateObject("notes.notessession")
Set oDB = oSess.getdatabase("SERVER NAME HERE", "")
Call oDB.openmail
flag = True

With ThisWorkbook.Sheets("Send Parameters") 'I set up a
datalist in the workbook for this
AttachPath = .Range("AttachPath") 'You can do
this with text
AttachName = .Range("AttachName") '
To_Address = .Range("To_Address") '
To_Name = .Range("To_Name") '
InstrText = .Range("InstrText") '
End With
AttachFile = AttachPath & "/" & AttachName

msg0 = "AUTOMATED MESSAGE TEXT IF DESIRED"
If Not (oDB.IsOpen) Then flag = oDB.Open("", "")
If Not flag Then
MsgBox "Cant't open mail file: " & oDB.server & " " &
oDB.FilePath
GoTo Error1
End If

Set oDoc = oDB.createdocument
Set oItem = oDoc.createrichtextitem("BODY")
oDoc.Form = "Memo"
oDoc.Subject = "Estimate To Complete File for Review"

oItem.appendtext ("ETC File Attachment")
oItem.addnewline (2)

On Error GoTo err02
oItem.embedObject 1454, "", AttachFile, "mail.rtf"

S001:
If rtn01 = vbOK Then msg = NoAttach_msg & msg
oDoc.sendto = To_Address
oDoc.body = msg0
oDoc.postdate = Date
oDoc.SaveMessageOnSend = True
oDoc.Send False
Exit Sub
Error1:
On Error Resume Next
MsgBox "Error in Lotus Notes Email Script"
Set oItem = Nothing
Set oDoc = Nothing
Set oDB = Nothing
Set oSess = Nothing
Exit Sub

err02:
Err.Clear
msg1 = "Attachment: [" & AttachName & "]" & " Was Not
Found in" & vbCrLf & " Directory: [" & AttachPath & "]"
msg1 = msg1 & vbCrLf & vbCrLf
msg1 = msg1 & "Do you wish to send advisory email without
attachment?"
rtn01 = MsgBox(msg1, vbCritical + vbOKCancel, "PSR SendMail
Utility")
If rtn01 = vbOK Then Resume S001
msg2 = "SendMail Routine Aborted for Recipient:" & vbCrLf &
" [" & To_Address & "]"
rtn02 = MsgBox(msg2, vbOKOnly, "PSR SendMail Utility")
End Sub



"Bob" wrote in message
...
Hello,

Can anybody give me an idea or tips on how to create a VBA
or macro code sending an email using Lotus Notes R5.

I would appreciate very much your help.

Thanks
Bob



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lotus notes email pdaws Excel Worksheet Functions 2 October 2nd 08 04:08 PM
Sending Excel Worksheet in 2007 to Lotus Notes Valerie Setting up and Configuration of Excel 1 May 20th 08 02:24 PM
Sending An Email To Web-Based Lotus Notes 7 SEAN DI''''ANNO Excel Discussion (Misc queries) 0 June 7th 07 10:16 AM
Why won't AOL email communicate with lotus notes email? ManInaMaze Excel Discussion (Misc queries) 0 August 3rd 05 02:41 AM
Sending e-mail with Lotus Notes pressing an excel button AndyOne Excel Discussion (Misc queries) 0 June 1st 05 09:29 PM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"