Salut moi j'utilise ce code, il marche plutôt bien ...
Sub piece_a_commander()
With ActiveSheet.PageSetup
.Orientation = xlLandscape
Worksheets("Fiche de réparation").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Users\TECH\Desktop\enregistrement2 PDF.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
If .Orientation = xlLandscape Then
.Orientation = xlPortrait
End If
.Orientation = xlLandscape
End With
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim olFormatHTML As String
FileAttach = "C:\Users\TECH\Desktop\enregistrement2 PDF.pdf" _
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Information sur la mise à jour"
On Error Resume Next
With OutMail
.To = "ADRESSE@HOTMAIL.FR..."
.BCC = ""
.Subject = "SUJET "
.BodyFormat = olFormatHTML
.HTMLBody = "Bonjour, <BR><BR>Ce message vous informe que " & Worksheets("Fiche de réparation").Cells(3, "I") & " demande la commande des pièces suivantes:<BR><BR><BR> " & Worksheets("Fiche de réparation").Cells(30, "A") & " <BR> pour la pièce " & Worksheets("Fiche de réparation").Cells(2, "I") & " .<BR><BR>" _
& "<A href=" & """" & "\\Nom_serveur\Repertoire\nom_ficihier.xls" & """" & "></A>" & Chr(10) & "<BR><BR>Cordialement"
.Attachments.Add enregistrement2_PDF
.Attachments.Add (FileAttach)
.OriginatorDeliveryReportRequested = False
.ReadReceiptRequested = False
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Il ne te reste plus qu' l'adapter avec le nom de ta feuille et le HTMLBody en fonction du texte que tu veux envoyer. Bien sûr pense a modifier le lien d’accès en fonction de ou se situe ton fichier...
Si jamais tu as des questions dessus hésite pas. Je suis nouveau en VBA mais je peux toujours essayer