View Single Post
  #1  
Old December 18th 08, 12:02 AM posted to microsoft.public.outlook.program_vba
thomas
external usenet poster
 
Posts: 32
Default Sending mails from Excel 2003 - Outlook signature

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

Ads