Boucle infinie dans envoie mail avec lotus notes

bonjour,

solution pour attachment

à tester,

Sub test()
Dim rng As Range
da = Sheets("sheet1").Range("B" & Rows.Count).End(xlUp).row
For Each rng In Sheets("Sheet1").Range("a2:a" & da)

If Application.WorksheetFunction.Text(VBA.Now() - rng.Offset(0, 1).Value, "[HH]") * 1 > 48 And rng.Offset(0, 2).Value = "" Then
Call send_email(rng.Value, rng.Row)

End If

Next

End Sub

Sub send_email(emailto As String, ROWNO As Long)
Dim noSession As Object
Dim noDatabase As Object
Dim noDocument As Object
'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument

With noDocument
.Form = "Memo"
.SendTo = "otmano@gmail.com"
.Subject = "Alarme non validation projet dans la ligne " & ROWNO
.Body = "Bonjour," & vbNewLine & vbNewLine & vbNewLine & "Pensez SVP a valider le dossier dans la ligne " & ROWNO & vbNewLine & vbNewLine & vbNewLine & " Cordialement"
.SaveMessageOnSend = True
.PostedDate = Now()
fileattach="c:\document.txt" ' nom du fichier à joindre
Set Am = .CreateRichTextItem("Pièce_jointe")
Set Eo= Am.embedobject(1454, "Pièce_jointe",fileattach, "")
.Send 0, emailto
End With
set Am=nothing
set Eo=nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

End Sub

bonjour,

Merci pour le code ça marche parfait

peux tu m'expliquer stp cette ligne (sutout le 1454) :

Set Eo= Am.embedobject(1454, "Pièce_jointe",fileattach, "")

merci

bonjour,

1454 indique que l'objet que l'on veut joindre au message est un attachment.

voir ici

Bonjour,

Merci h2so4, je continuerai mes recherches pour faire clignoter les cellules en retard en rouge, j'en ai déjà vu ça mais j'ai oublié ou exactement

Bonne fin de journée

@+

Rechercher des sujets similaires à "boucle infinie envoie mail lotus notes"