Il ne s'agit pas ici d'envoyer un classeur mais plutôt un fichier texte.
Pierre
"lSteph" a écrit dans le message de news:
.. dans ce cas pour envoyer un classeur utiliser SendMail
lSteph
Pierre Archambault avait soumis l'idée :
Merci
Cependant, y aurait-il moyen de spécifier l'adresse du destinataire, le nom du fichier à joindre et un court texte pour l'objet du message.
Pierre
"lSteph" a écrit dans le message de news:
Bonjour, ex avec OE
Private Sub CommandButton1_Click() Shell ("C:Program FilesOutlook Expressmsimn.exe"), vbMaximizedFocus Application.SendKeys "%fnm", 1 End Sub
'lSteph
Pierre Archambault avait écrit le 29/10/2006 :
Bonjour à tous,
Je me demande comment faire pour envoyer un courrier électronique en cliquant sur un bouton dans un UserForm.
Merci
Pierre
-- - -
-- - -
JB
Bonsoir,
http://cjoint.com/?kDvvWbZFuM
Private Sub B_go_Click() If Me.Destinataire = "" Then MsgBox "Saisissez un destinataire!" Me.Destinataire.SetFocus Exit Sub End If If Me.Sujet = "" Then MsgBox "Saisissez un sujet!" Me.Sujet.SetFocus Exit Sub End If Dim olapp As Outlook.Application Dim msg As MailItem Set olapp = New Outlook.Application Set msg = olapp.CreateItem(olMailItem) msg.To = Me.Destinataire msg.Subject = Me.Sujet msg.Body = Me.Message msg.Send End Sub
JB
Bonjour à tous,
Je me demande comment faire pour envoyer un courrier électronique en cliquant sur un bouton dans un UserForm.
Merci
Pierre
Bonsoir,
http://cjoint.com/?kDvvWbZFuM
Private Sub B_go_Click()
If Me.Destinataire = "" Then
MsgBox "Saisissez un destinataire!"
Me.Destinataire.SetFocus
Exit Sub
End If
If Me.Sujet = "" Then
MsgBox "Saisissez un sujet!"
Me.Sujet.SetFocus
Exit Sub
End If
Dim olapp As Outlook.Application
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = Me.Destinataire
msg.Subject = Me.Sujet
msg.Body = Me.Message
msg.Send
End Sub
JB
Bonjour à tous,
Je me demande comment faire pour envoyer un courrier électronique en
cliquant sur un bouton dans un UserForm.
Private Sub B_go_Click() If Me.Destinataire = "" Then MsgBox "Saisissez un destinataire!" Me.Destinataire.SetFocus Exit Sub End If If Me.Sujet = "" Then MsgBox "Saisissez un sujet!" Me.Sujet.SetFocus Exit Sub End If Dim olapp As Outlook.Application Dim msg As MailItem Set olapp = New Outlook.Application Set msg = olapp.CreateItem(olMailItem) msg.To = Me.Destinataire msg.Subject = Me.Sujet msg.Body = Me.Message msg.Send End Sub
JB
Bonjour à tous,
Je me demande comment faire pour envoyer un courrier électronique en cliquant sur un bouton dans un UserForm.