Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Senkeys

15 réponses
Avatar
Brat'ac
Bonjour,

Je cherche comment faire pour en VBA envoyer la combinaison de touche
"CTRL + ENTER" et "ALT + F" avec Application.Sendkeys

Merci

5 réponses

1 2
Avatar
Brat'ac
isabelle vient de nous annoncer :
as-tu un gmail ?





Oui j'ai, et je viens d'essayer et et ..... perdu j'ai le même message
d'erreur, c'est à désespérer :-@

Ma version d'Excel ? refaire l'installation d'Excel ? Une grosse M...E
dans mon système ? >:|
Avatar
isabelle
en espèrent que tu aies oe,

'Cette macro envoie la plage A1:A10, vous pouvez évidement modifier cette ligne Range("A1:A10").Copy
'pour envoyer une autre plage de cellules.

Sub EnvoiSelectionparMail()
Dim Dest, Sujt, Msg As String
Dim TheFile
Range("A1:A10").Copy
Workbooks.Add
ActiveSheet.Paste
ActiveWorkbook.SaveAs Filename:="C:temptest.xls"

TheFile = "C:temptest.xls"
Dest = "" '<-------------------------------- adapter
Sujt = "Test d'envoi avec Excel"
Msg = "Bonjour, Excel vous envoie une plage de cellules avec OE"

Shell "C:Program FilesOutlook Expressmsimn.exe " & _
"/mailurl:mailto:" & Dest & "?subject=" & Sujt & "&Body=" & Msg & ""
SendKeys "%I" & "p" & TheFile & "~" & "%s"
ActiveWorkbook.Close
End Sub


--
isabelle



Le 2012-02-05 10:38, Brat'ac a écrit :
isabelle vient de nous annoncer :
as-tu un gmail ?





Oui j'ai, et je viens d'essayer et et ..... perdu j'ai le même message d'erreur, c'est à désespérer :-@

Ma version d'Excel ? refaire l'installation d'Excel ? Une grosse M...E
dans mon système ? >:|


Avatar
Brat'ac
isabelle a exposé le 05/02/2012 :
en espèrent que tu aies oe,



Helas non,

Bon j'abandonne, je vais faire un batch avec le petit prog
"Sendail.exe"
et une tache planifiée.

Merci à tous.
Avatar
isabelle
dommage, une dernière tentative,


Sub envoi_mails_Mozilla_Thunderbird()

destinataire = ""
sujet = "Salut!"
body = "ca va ?"
fichierjoint = fichier

strCommand = "C:Program FilesMozilla Thunderbirdthunderbird"
strCommand = strCommand & " -compose " & "mailto:" & destinataire & "?"
strCommand = strCommand & "&" & "subject=" & sujet & "&"
strCommand = strCommand & "body=" & body & "&"
strCommand = strCommand & "attachment=" & fichierjoint

Call Shell(strCommand, vbNormalFocus)
SendKeys "%(fv)", True 'combinaison des touches Alt+f+v (fichier, envoyer)

End Sub

http://kb.mozillazine.org/Command_line_arguments_(Thunderbird)



--
isabelle



Le 2012-02-05 12:57, Brat'ac a écrit :
isabelle a exposé le 05/02/2012 :
en espèrent que tu aies oe,



Helas non,

Bon j'abandonne, je vais faire un batch avec le petit prog "Sendail.exe"
et une tache planifiée.

Merci à tous.


Avatar
Brat'ac
isabelle avait écrit le 06/02/2012 :
dommage, une dernière tentative,



Bonjour,
Bon finalement avec quelques modifications ça marche.

Merci Isabelle, et bonne journée

GS
--------------------------------------------------------
Sub Mail()
Dim destinataire, Sujet, Mes, fichierjoint As String
destinataire = ""
Sujet = "Fichier Garderie"
body = "Ci-joint le fichier du jour"
fichierjoint = "C:saisie.csv"
strcommand = "C:Program FilesMozilla Thunderbirdthunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire & "'"
strcommand = strcommand & "," & "subject=" & Sujet & ","
strcommand = strcommand & "body=" & body
strcommand = strcommand & "," & "attachment=file:///" & fichierjoint
Call Shell(strcommand, vbNormalFocus)
SendKeys "%(f^~)", True
SendKeys "^(~)", True
SendKeys "~", True
End Sub
1 2