Bonjour,
sou excel 2003
Dans le module ci-après je souhaite avant envoi du fichier en pièce jointe le renommer avec le contenu des cellules b18 et b19 de la feuille nommée FDD.
Merci d'avance pour votre éclairage.J'ai fais quelques tests mais sans succès.
Sub SendEMailwithAttachments()
Dim ol As Object, myItem As Object
Dim strHtml As String
 
strHtml = "Bonjour , <BR><BR>"
strHtml = strHtml & "<B><font size=4mm>" & _
"Veuillez trouver çi-joint une fiche de liaison provenant de la PFV</font></B>"
strHtml = strHtml & "<BR><BR>" & _
"<font color=black>Cordialement</font>" & "<BR><BR>"
strHtml = strHtml & Environ("UserName") & " " & Range("b10").Value
strHtml = strHtml & ""
 
Set ol = CreateObject("outlook.application")
Set myItem = ol.CreateItem(olMailItem)
 
myItem.To = Range("D32").Value
myItem.Subject = "fiche de liaison PFV" & "de" & " " & Range("b13").Value
myItem.HtmlBody = strHtml
'fichier en cours d'utilisation envoyé en attaché:
myItem.Attachments.Add ActiveWorkbook.FullName
myItem.Send
 
Set ol = Nothing
 
End Sub
	
		
			
		
		
	
				
			sou excel 2003
Dans le module ci-après je souhaite avant envoi du fichier en pièce jointe le renommer avec le contenu des cellules b18 et b19 de la feuille nommée FDD.
Merci d'avance pour votre éclairage.J'ai fais quelques tests mais sans succès.
Sub SendEMailwithAttachments()
Dim ol As Object, myItem As Object
Dim strHtml As String
strHtml = "Bonjour , <BR><BR>"
strHtml = strHtml & "<B><font size=4mm>" & _
"Veuillez trouver çi-joint une fiche de liaison provenant de la PFV</font></B>"
strHtml = strHtml & "<BR><BR>" & _
"<font color=black>Cordialement</font>" & "<BR><BR>"
strHtml = strHtml & Environ("UserName") & " " & Range("b10").Value
strHtml = strHtml & ""
Set ol = CreateObject("outlook.application")
Set myItem = ol.CreateItem(olMailItem)
myItem.To = Range("D32").Value
myItem.Subject = "fiche de liaison PFV" & "de" & " " & Range("b13").Value
myItem.HtmlBody = strHtml
'fichier en cours d'utilisation envoyé en attaché:
myItem.Attachments.Add ActiveWorkbook.FullName
myItem.Send
Set ol = Nothing
End Sub