T
thomas
Hello,
I use vba to send outlook mails from excel 2003 :
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)
With MonMail
.Display ' retirer
le commentaire si vous voulez que le fenêtre Outlook s'affiche
.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
I have few problems :
1/ Is there a way to avoid the outlook 2003 confirmation box ?
2/ the confirmation box opens in the left corner of the mail windows. Is it
possible that it be centered?
3/ I would like to format some parts of the body. Is there a way to do it?
4/ Is there a property to add the default signature of outlook 2003 to the
body?
Many thanks for your help
I use vba to send outlook mails from excel 2003 :
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)
With MonMail
.Display ' retirer
le commentaire si vous voulez que le fenêtre Outlook s'affiche
.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
I have few problems :
1/ Is there a way to avoid the outlook 2003 confirmation box ?
2/ the confirmation box opens in the left corner of the mail windows. Is it
possible that it be centered?
3/ I would like to format some parts of the body. Is there a way to do it?
4/ Is there a property to add the default signature of outlook 2003 to the
body?
Many thanks for your help