Bonjour,
Je cherche actuellement via Excel vba à répondre à un mail situé dans une app sur serveur.
Je ne trouve malheureusement pas mon bonheur, est-ce quelqu'un connait une technique pour ce faire ?
Merci
Public Function openLegalClaim(legalclaim As String)
Dim dbname As String
Dim dbpath As String
Dim docname As String
Dim notesuiworkspace As Object
docname = legalclaim
Set notesuiworkspace = CreateObject("Notes.Notesuiworkspace")
dbname = "<dbname>"
dbpath = "<dbserverpath>"
Call notesuiworkspace.OpenDatabase(dbpath, dbname, "<viewname>", docname, False, False)
End Function
Public Sub Send()
Dim session As Object 'Session Notes
Dim Dir As Object
Dim Doc As Object
Dim AttachME As Object 'Objet richtext
Dim EmbedObj As Object 'Objet embed du richtext
Dim Footpage As Object 'pied de page
Dim Workspace As Object
Dim EditDoc As Object
Dim Attachment As String
Dim cc As String
Dim time As String
On Error GoTo TraiteErreur
'Création de la session Notes
Set Workspace = CreateObject("Notes.NotesUIWorkspace")
Set session = CreateObject("notes.NOTESSESSION")
Set Dir = session.GetDatabase("XXXXXX/XXXXX/XXXXX", "rep/rep1/base.nsf")
'Sauvegarde du rapport & contruction de la variable pour l'attachement au mail
ActiveWorkbook.Save
Attachment = ActiveWorkbook.Path + "\" + ActiveWorkbook.Name
'Creation d'un document
Set Doc = Dir.CreateDocument
Set AttachME = Doc.CREATERICHTEXTITEM("BODY")
'Set EmbedObj = AttachME.EmbedObject(1454, "", Attachment, "BODY")
Doc.form = "Memo"
Doc.Subject = "Rapport OROP de la nuit du " & Date - 1 & " au " & Date
Doc.SendTo = ""
Doc.CopyTo = cc
Doc.body = "Bonjour," & vbLf & vbLf & "ci-joint les rapports OROP de la nuit du " & Date - 1 & " au " & Date & vbLf & vbLf & "Cordialement," & vbLf & "Team GPMX"
'Joindre le fichier OROP en PJ
Set EmbedObj = AttachME.EmbedObject(1454, "", Attachment, "BODY")
'Affichage du mail dans Lotus Notes
Set EditDoc = Workspace.EDITDOCUMENT(True, Doc)
Set session = Nothing
Set Dir = Nothing
Set Doc = Nothing
Set Workspace = Nothing
Set EditDoc = Nothing
Exit Sub
TraiteErreur:
'MsgBox "Problème de création du mail", vbCritical, "Error"
Set session = Nothing
Set Dir = Nothing
Set Doc = Nothing
Set Workspace = Nothing
Set EditDoc = Nothing
End Sub