T
thomas
Hello,
Few months ago i asked ho to insert the outlook 2003 default signature to a
mail sent from excel vba
I was advised to use ".GetInspector" but i still cannot make it work.
I get an error message saying "read only property"
My code is :
Sub EnvoiMailMéthodeOLE(Adresse As String, Objet As String, Corps As String,
Optional Pièce As String, Optional Cc As String, Optional Bcc As String)
Dim MonAppliOutlook As New Outlook.Application
Dim MonMail As Outlook.MailItem
Dim MaPièce As Outlook.Attachments
Set MonMail = MonAppliOutlook.CreateItem(olMailItem)
MonAppliOutlook = MonMail.GetInspector
With MonMail
.Display '
.To = Adresse
If Not IsNull(Cc) Then .Cc = Cc
If Not IsNull(Bcc) Then .Bcc = Bcc
.Subject = Objet
.Body = Corps
If Not IsNull(Pièce) Then
Set MaPièce = .Attachments
MaPièce.Add Pièce, olByValue
End If
.Send
End With
End Sub
Thanks for you help
Few months ago i asked ho to insert the outlook 2003 default signature to a
mail sent from excel vba
I was advised to use ".GetInspector" but i still cannot make it work.
I get an error message saying "read only property"
My code is :
Sub EnvoiMailMéthodeOLE(Adresse As String, Objet As String, Corps As String,
Optional Pièce As String, Optional Cc As String, Optional Bcc As String)
Dim MonAppliOutlook As New Outlook.Application
Dim MonMail As Outlook.MailItem
Dim MaPièce As Outlook.Attachments
Set MonMail = MonAppliOutlook.CreateItem(olMailItem)
MonAppliOutlook = MonMail.GetInspector
With MonMail
.Display '
.To = Adresse
If Not IsNull(Cc) Then .Cc = Cc
If Not IsNull(Bcc) Then .Bcc = Bcc
.Subject = Objet
.Body = Corps
If Not IsNull(Pièce) Then
Set MaPièce = .Attachments
MaPièce.Add Pièce, olByValue
End If
.Send
End With
End Sub
Thanks for you help