OVH Cloud OVH Cloud

extraire 1 page de tableau xls + la joindre ds 1mail outlook xprs

1 réponse
Avatar
SylvainT
Comment extraire 1 page d'un tableau xls et la joindre à un courriel outlook
express sans que la totalité du tableau ne soit envoyée (+/- 4500 ko) ?
Merci à tous. TS.-

1 réponse

Avatar
ThierryP
Bonjour SylvainT,

Avec ceci à adpater à ta situation (XL2002 + W2K SP4) :

Sub EnvoiMail()
Dim iMsg As Object, iConf As Object, WBname, NumCde As String
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
' Renseigner ci-dessous avec le smtp de l'utilisateur
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "le nom de ton SMTP"

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"ton login"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"ton mot de passe"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
Application.ScreenUpdating = False
NumCde = Range("F16").Value '------> Cette ligne me permet de choisir
'un numéro d'onglet dans mon classeur
ActiveWorkbook.SaveCopyAs "C:Commande.xls" '--> Nom et chemin à adapter
strbody = "Bonjour " & vbNewLine & vbNewLine & _
"Veuillez trouver ci-joint ma commande " & NumCde &
vbNewLine & _
"Merci de me confirmer prix et délais par retour" &
vbNewLine & _
"En l'attente," & vbNewLine & "Meilleures salutations"
With iMsg
Set .Configuration = iConf
.To = Range("B15").Value
.CC = ""
.BCC = ""
.From = """Thierry"" <ton adresse mail>"
.Subject = "Commande"
.TextBody = strbody
.AddAttachment "C:Commande.xls"
.Fields.Update
.Send
End With
ActiveWorkbook.Close
Kill "C:Commande.xls"
Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
End Sub


Comment extraire 1 page d'un tableau xls et la joindre à un courriel outlook
express sans que la totalité du tableau ne soit envoyée (+/- 4500 ko) ?
Merci à tous. TS.-


--
@+ thierryp