Coller un texte du presse papier vers une application externe avec VBA sur Excel
Sormick
Messages postés
163
Statut
Membre
-
yg_be Messages postés 24281 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 24281 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
Je n'arrive pas à coller un texte sur une application externe avec SENDKEYS
Pouvez vous m'aider s'il vous plait car je ne comprends pas.
Voici ci-dessous mon code:
Je n'arrive pas à coller un texte sur une application externe avec SENDKEYS
Pouvez vous m'aider s'il vous plait car je ne comprends pas.
Voici ci-dessous mon code:
Sub test()
Dim mydata
Dim toto As String
Dim hwnd&, Style&, Title$, i&
hwnd = GetWindow(GetDesktopWindow(), 5)
Do While hwnd
Title = GetCaption(hwnd)
If Len(Title) Then
' Enum visible windows only
If GetWindowLong(hwnd, -16) And &H10000000 Then
If InStr(1, Title, "échantillonnage", 1) Then
ShowWindow hwnd, SW_SHOWNORMAL
AppActivate Title
Application.Wait Now + TimeValue("0:00:01")
Application.SendKeys "^v", True
SendKeys "{ENTER}", True
Application.Wait Now + TimeValue("0:00:01")
Dim Num As Boolean
'Récupère l'état des LED's
If (&H1 And GetKeyState(vbKeyNumlock)) <> 1 Then Num = False
If Num = False Then 'test si eteint
SendKeys "{NUMLOCK}" 'remet la led en état activé
End If
Exit Sub
End If
End If
End If
hwnd = GetWindow(hwnd, 2)
Loop
End Sub
A voir également:
- Echec du copier vers le presse papier autocad
- Presse papier - Guide
- Presse-papier - Guide
- Mode sans echec ps4 - Guide
- Presse papier iphone ou le trouver ✓ - Forum Windows 7
- Dessin sms copier coller zizi ✓ - Forum Réseaux sociaux
1 réponse
yg_be
Messages postés
24281
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 585
bonjour, as-tu essayé ceci:
Application.SendKeys "SoRmIcK", True?
yg_be
Messages postés
24281
Date d'inscription
Statut
Contributeur
Dernière intervention
1 585
as-tu essayé?