Lotus Notes mail with VBA

mswantek

Board Regular
Joined
Jul 9, 2002
Messages
123
Help!!

I am trying to use VBA to send along a sheet . The code works for everything but the return reciept.
Does anyone have expirience in Lotus Notes being used from VBA????

'send the mail
Application.Dialogs(xlDialogSendMail).Show _
arg1:="someone@somewhere", _
arg2:=Range("d4") & " CRITERIA TRANSMITTAL FROM " & Range("c29"), _
arg3:=ReturnReceipt

I have tried looking in the Lotus notes help and this is what they gave.

Syntax
@MailSend
@MailSend( sendTo ; copyTo ; blindCopyTo ; subject ; remark ; bodyFields ; [ flags ] )

The available flags are:
[Sign]
Electronically sign the memo when mailing it, using information from the user's ID. Signing will not occur unless you include this flag.
[Encrypt]
Encrypt the document using the recipient's public key, so that only the recipient whose private key matches can read the document. Encryption will not occur unless you include this flag.
[PriorityHigh]
Immediately routes the message to the next­hop server as defined by the combination of Mail Connection records and server records. If a phone call has to be made in order to route the message, then the call is placed immediately, regardless of the schedule set in the Remote Connection record. If you omit this flag, the priority defaults to Normal.
[PriorityNormal]
Routes the message to the next­hop server based on the schedule defined in the Mail Connect records. If the recipient's mail file resides on a server on the same Domino network, then delivery occurs immediately. If you omit this flag, the priority defaults to Normal.
[PriorityLow]
Routes the message overnight if the recipient's mail file does not reside on a server on the same Notes/Domino network. If the recipient's mail file does reside on a server on the same Notes/Domino network, then delivery occurs immediately. Low Priority mail can also be controlled by a Notes/Domino environment variable called MailLowPriorityTime=x, where x is equal to a number from 0 to 23. When placed in the server notes.ini file, this variable tells the server when to route Low Priority mail. If you omit this flag, the priority defaults to Normal.
[ReturnReceipt]
Notify the sender when each recipient reads the message. No receipt is returned unless you include this flag.
[DeliveryReportConfirmed]
Notify the sender whether delivery of the memo was successful or not. By default, the Basic delivery report is used, which notifies the sender only when a delivery failure occurs.

Any clues???
I need this to have a return reciept or I cant use it..........

MAny thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi,

If You´re prepared to replace Your present approach with below then it might help You.

Search the archieve to find the code to attach a workbook / worksheet to a Lotus-mail. The sample below paste a range into the body of the e-mail.

However, my own experience is that mailreciept is not always working as expected due to clients-softwares and the settings on the mail-server.

Nevertheless - Here we go:

Option Explicit

Sub Send_Range_Lotus()
'Using late binding for Lotus
'A reference to Microsoft Forms 2.0 object library must be set.

Dim noSession As Object, noDatabase As Object, noDocument As Object
Dim stSubject As Variant, stTitle As String
Dim vaRecipient As Variant, vaMsg As Variant
Dim rnBody As Range
Dim Data As DataObject

stSubject = "Standardmessage, automation e-mail."

Do
vaRecipient = Application.InputBox( _
Prompt:="please entrer the recipient mailaddress:" & _
vbCrLf & "(excel@microsoft.com or just the name)", _
Title:="Recipient", _
Type:=2)
Loop While vaRecipient = ""

If vaRecipient = False Then Exit Sub

Do
vaMsg = Application.InputBox( _
Prompt:="Please enter the message-text:", _
Title:="Message", _
Type:=2)
Loop While vaMsg = ""

On Error Resume Next
Set rnBody = Application.InputBox("Please enter the range:", _
, Selection.Address, , , , 8)
If rnBody Is Nothing Then Exit Sub
On Error GoTo 0

Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

Set noDocument = noDatabase.CreateDocument
rnBody.Copy
Set Data = New DataObject
Data.GetFromClipboard

With noDocument
.Form = "Memo"
.SendTo = vaRecipient
.Subject = stSubject
.Body = Data.GetText
.Importance = "1"
.ReturnRecipiet = "1"
.SaveMessageOnSend = True
End With

noDocument.PostedDate = Now()
noDocument.Send 0, vaRecipient

Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

AppActivate "Microsoft Excel"
Application.CutCopyMode = False

MsgBox "E-mail have been created.", vbInformation

End Sub


Kind regards,
Dennis
 
Upvote 0
I have tried copying in the code below

but I dont understnd how to


"A reference to Microsoft Forms 2.0 object library must be set. "

how do I do this

thanks
Stuart
 
Upvote 0
In Tools | References, look for that entry (Microsoft Forms 2.0 Object Library)

or, another option, easier, is just to Insert a Userform. You can remove it later.
 
Upvote 0

Forum statistics

Threads
1,218,174
Messages
6,140,920
Members
450,320
Latest member
NewExcelUser101

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top