PDA

View Full Version : Send Mail VBA LOTUS NOTES



PORKOLAB SYL
11-28-2017, 03:00 AM
Hello Every Body ,

Firstofall my english is intermediate ...:whistle::whistle::whistle:

I would like to send by VBA a email with attachment ( Mail box : Lotus Notes , and Excel 2016 )

Please find attached picture of my folder Excel :21072

My request is : I have suppliers codes Or there is an email address assigned ( column I ) , i would like to send the all Lines assigned by supplier and not the tab.

i have begin a VBA code but ... it's too complicated for my level on VBA

Application.ScreenUpdating = False
'lefichier = ThisWorkbook.Path & "\Nom de mon fichier.xlsm"
lefichier = "***"
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)

Attachment = lefichier

'************** Application.Dialogs(xlDialogSendMail).Show
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.SylvainPORKOLAB/0G/Caterpillar
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.CAT - B5 - 2 / Servers / Caterpillar("", MailDbName)
If Maildb.IsOpen = True Then
'Already open for mail


i hope to been clair ...


Merci les amis !:(

SamT
11-29-2017, 08:13 AM
Moderator Bump