Bonjour,
J'ai un bout de code suivant :
Sub Envoipdfpoursuites()
Dim a As Integer
Dim objOutlook As Object
Dim objMail As Object
Dim rngTo As Range
Dim rngSubject As Range
Dim rngBody As String
Dim rngAttach As Range
Dim rngCC As Range
Dim ligne1 As String
Dim ligne2 As String
'enregistrement pdf
'Exporte vers PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("I6").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
a = ActiveCell.Row
With ActiveSheet
Set rngTo = .Cells(12, 3)
Set rngSubject = .Cells(7, 9)
Set rngCC = .Cells(8, 9)
Set rngAttach = .Cells(6, 9)
End With
ligne1 = "Remplacer par un texte d'email"
With objMail
.To = rngTo.Value
.Subject = rngSubject.Value
.CC = rngCC.Value
.Body = ligne1 & "<HR>" & ligne2
.Attachments.Add rngAttach.Value
.Display 'Instead of .Display, you can use .Send to send the email _
or .Save to save a copy in the drafts folder
End With
Set objOutlook = Nothing
Set objMail = Nothing
Set rngTo = Nothing
Set rngSubject = Nothing
Set rngAttach = Nothing
End Sub
Je souhaite écrire Madame, Monsieur, puis retour à la ligne et le reste du texte : Nous vous prions de trouver en pièce jointe............
Je ne sais pas où intégrer ce texte et surtout comment ?