Attachment in Lotus Notes

dempa79

New Member
Joined
Jun 12, 2006
Messages
14
I am using this code to send a report and the mail is not automaticaly sent beacuse i need to controll the mail before i send it. Now i want to use my code to automatically create an mail with an attached file. I have found some code in this forum but the problem is that i want to autmatically create but not send it....


Sub mail_wassum()

Dim oWorkSpace As Object, oUIDoc As Object, Notes As Object
Dim stTo As String, stCC As String, stSubject As String, stBody As String
Dim rnBody As Range
Dim lnRetVal As Long

lnRetVal = FindWindow("NOTES", vbNullString)

If lnRetVal = 0 Then
MsgBox "Lotus Notes måste vara öppnat.", _
vbInformation, "Systemfel-Lotus Notus"
Exit Sub
End If

Application.ScreenUpdating = False

Set oWorkSpace = CreateObject("Notes.NotesUIWorkspace")

stTo = "vp.prices@wassum.com,"
stCC = ""
stSubject = "Luxkurser" & " " & Date

'För att få en radbrytning i förhållande till den inklistrade bilden.

stBody = "Med vänlig hälsning"

Workbooks("Navcenter").Sheets("Data till Wassum").Activate
Range("A1:F9").Copy

On Error Resume Next

Set oUIDoc = oWorkSpace.composeDocumen _("W19723/EJBY/DDB", "DEPTMAIL\4253R4253BAC.nsf", "Memo")

On Error GoTo 0

Set oUIDoc = oWorkSpace.CurrentDocument

Call oUIDoc.FieldSetText("EnterSendTo", stTo)

Call oUIDoc.FieldSetText("EnterCopyTo", stCC)

Call oUIDoc.FieldSetText("Subject", stSubject)
Call oUIDoc.FieldSetText("Body", stBody)
Call oUIDoc.GoToField("Body")
Call oUIDoc.Paste

Set oUIDoc = Nothing

With Application
.CutCopyMode = False
.ScreenUpdating = True
End With

MsgBox "E-post har skapats,sparats men inte sänts iväg.", vbInformation

AppActivate ("Notes")

End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
If Lotus Notes is your default email application, you can create (but not send) an email with the current workbook as an attachment by using the following code:

Code:
    ActiveWorkbook.SendMail Recipients:="XLhelp@4XLSolutions", Subject:="test"
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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