Bonjour ,
La procédure ci dessous fonctionne parfaitement sous editeur word 2002 pour outlook .
Sous editeur word 2003 , j'ai soit le texte du message mis en forme , soit l'image ,mais jamais les deux ensemble .
Pouvez-vous m'aider? merci d'avance
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| Sub prepare_message()
'Sub Mail_Outlook_With_Signature_Plain()
' Don't forget to copy the function GetBoiler in the module.
' Working in Office 2000-2010
Dim outapp As Object
Dim outmail As Object
Dim omail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Dim ListePJ As String
Dim strfile As String
Dim strFolderpath As String
Dim PJ As String
Dim FileName As String
Dim A As Application
Dim destinataire As String
Dim myAttachment As Outlook.Attachment
Dim fichier As String
topmost = True
Set outapp = CreateObject("Outlook.Application")
Set outmail = outapp.ActiveInspector.CurrentItem
'Call SaveAtts
strbody = "Objet: " & outmail.Subject & Chr$(13) & _
"Envoyé le " & Mid(Date$, 4, 2) & "/" & Mid(Date$, 1, 2) & "/" & Mid(Date$, 7, 4) & " ; " & Chr$(13) & Chr$(13) & _
"Bonjour," & vbNewLine & vbNewLine & _
"Conformément au texte RFN IG TR4 D3 n°1, veuillez trouver en pièce jointe le rapport d'enquête vous concernant." & vbNewLine & _
vbNewLine & _
"Cordialement" & vbNewLine & vbNewLine & _
"Direction de la circulation ferroviaire" & vbNewLine & _
"Division Veille IOS-V" & vbNewLine & _
"21 rue d'Alsace - 75475 PARIS CEDEX 10 (PARIS EST)"
'Use the second SigString if you use Vista or Win 7 as operating system
SigString = "C:\signatur macroc.txt"
If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = "DCF IOS-V"
End If
On Error Resume Next
With outmail
topmost = True
msg.Account = "Blanc"
.To = "dsin@sncf.fr" ' "smtp.lstdsin@infra.sncf.fr;"
.CC = "archiver7j@elinkinfra.sncf.fr;"
.BCC = ""
'.Subject = "Envoi du Rapport 7 jours"
.Body = strbody & vbNewLine & vbNewLine
'Call position
outmail.htmlbody = outmail.htmlbody & "<HTML><body><IMG src=""w:\ios-t\jf\logoafaq.jpg"" width=100 height=100 border=0 /> </BODY></HTML>"
outmail.Display
End With
On Error GoTo 0
'Call PilotageExcel
Set outmail = Nothing
Set outapp = Nothing
Selection.WholeStory
With Selection.Font
.Name = "comic"
.Size = 14
.Italic = wdToggle
End With
End Sub |