Thanks,
Hereunder my code. It always works fine excepted when the word option is
checked
In such a cas i only get the signature
Private Function EnvoiMail_HTML(Adresse As String, Objet As String, Corps As
String, Optional Pièce As String, Optional Cc As String, Optional Bcc As
String, Optional Envoyer_Mail As Boolean)
Dim MonAppliOutlook As Outlook.Application
Dim MonMail As Outlook.MailItem
Dim MaPièce As Outlook.Attachments
Dim olInspector As Outlook.Inspector
Set MonAppliOutlook = CreateObject("Outlook.Application")
Set MonMail = MonAppliOutlook.CreateItem(olMailItem)
Set olInspector = MonMail.GetInspector
On Error Resume Next
With MonMail
If Affichage = True Then .Display Else
..GetInspector.CommandBars.Item("Insert").Controls("Signature").Controls(1).Execute
.To = Adresse
If Not IsNull(Cc) Then .Cc = Cc
If Not IsNull(Bcc) Then .Bcc = Bcc
.Subject = Objet
If Not IsNull(Pièce) Then
Set MaPièce = .Attachments
T = Split(Pièce, ";")
For i = 0 To UBound(T)
MaPièce.Add T(i), olByValue
Next i
End If
.BodyFormat = olFormatHTML
.HTMLBody = Corps & .HTMLBody
If Envoyer_Mail = True Then .Send
End With
Set MonAppliOutlook = Nothing
Set MonMail = Nothing
End Function
"Ken Slovak - [MVP - Outlook]" <
[email protected]> a écrit dans le message
de groupe de discussion : #
[email protected]...
You can't. Outlook reads the settings from the registry and then persists
them in memory. When you change the settings the new settings are written
out to the registry but not read again until Outlook closes and is
restarted. So any change you make there when Outlook is running already is
ignored while Outlook is running.
The answer is to correctly handle WordMail when it is being used. You can
always use the Body or HTMLBody properties whether or not WordMail is being
used. I don't know what your code is doing but I often modify Body or
HTMLBody irregardless if WordMail is being used.