Re : Pb expedition de Mail Lotus par VBA
Bonjour Bruno...
En fait j'ai essayé à peu prés toutes les combinaisons entre le get.. et le create, avec lotus ou notes...
et je tourne en rond...
tu as déjà fait la manip ou rencontré un pb similaire ??
merci pour ta reponse et bonne journée.
====
Function exp_mail()
On Error GoTo gesterror
dest = "srougevin@mousquetaires.com"
destcc = ""
sujet = "test de transmission"
'######################################################
'Option 1 == OK chez moi / KO ailleurs #429
'Set session = CreateObject("Notes.NotesSession")
'Option 2 == çà passe mais renvoie une erreur d'initialisation
'Set session = CreateObject("Lotus.NotesSession")
'Option 3 == OK chez moi / KO ailleurs #429
Set session = GetObject("", "Notes.Notessession")
'==??
'set session = getobject("","Lotus.Notessession")
'######################################################
'Set session = session.Initialize '===> renvoi "objet requis"
'session.Initialize '===> renvoi "a database name must be provided"
Set file = session.getdatabase("", "")
file.openmail
Set doc = file.createdocument
Set cham = doc.appenditemvalue("Subject", sujet)
Set cham = doc.appenditemvalue("SendTo", dest)
Set cham = doc.appenditemvalue("CopyTo", destcc)
Set cham = doc.createrichtextitem("Body")
With cham
.appendtext "..................."
.addnewline 2
'...
End With
cham = cham.embedobject(1454, "", ActiveWorkbook.FullName)
doc.send (0)
Set session = Nothing
Set file = Nothing
Set doc = Nothing
Set cham = Nothing
exp_mail = True
MsgBox ("Message transmis")
Exit Function
gesterror:
Msg = "Error # " & Str(Err.Number) & " qui vient de cette merde de " _
& Err.Source & Chr(13) & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
exp_mail = False
End Function