• Foruma hoş geldin 👋 Ziyaretçi

    Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Soru Listviewde checkbox selected whatsapp msj olarak gönderme

muammercaylak78

Yeni Üye
Katılım
12 Eki 2022
Mesajlar
84
Aldığı beğeni
10
Excel V
Office 2013 TR
Selamün Aleyküm iyi geceler Listviewdeki seçilenleri whatsapp da mesaj olarak göndermek istiyorum. mesaj butonda kod yazdım. sadece seçilen hücreleri gönderiyor. toplu bir şekilde göndermek istiyorum. yardımlarınız bekliyorum. dosya ektedir.
 

Ekli dosyalar

Çözüm
Merhaba,

Modül içindeki mesaj_gonder kod dloğunu aşağıdaki şekilde Userform içine alıp listview list count sayısına göre döngüye alabilirsiniz.


Kod:
Sub mesaj_gonder()
Dim kime As String
Dim metin As String

For i = 1 To Me.ListView2.ListItems.Count

If ListView2.ListItems.Item(i).Checked = True  Then

kime = Me.ListView2.ListItems(i)
metin = Me.ListView2.ListItems(i).SubItems(1)


ActiveWorkbook.FollowHyperlink Address:="https://web.whatsapp.com/"
Application.Wait (Now + TimeValue("00:00:10"))

Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys(kime, True)
Application.Wait (Now +...
Merhaba,

Modül içindeki mesaj_gonder kod dloğunu aşağıdaki şekilde Userform içine alıp listview list count sayısına göre döngüye alabilirsiniz.


Kod:
Sub mesaj_gonder()
Dim kime As String
Dim metin As String

For i = 1 To Me.ListView2.ListItems.Count

If ListView2.ListItems.Item(i).Checked = True  Then

kime = Me.ListView2.ListItems(i)
metin = Me.ListView2.ListItems(i).SubItems(1)


ActiveWorkbook.FollowHyperlink Address:="https://web.whatsapp.com/"
Application.Wait (Now + TimeValue("00:00:10"))

Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys(kime, True)
Application.Wait (Now + TimeValue("00:00:03"))
Call SendKeys("~", True)
Application.Wait (Now + TimeValue("00:00:05"))

Call SendKeys("^+V", True)
Application.Wait (Now + TimeValue("00:00:03"))
Call SendKeys("~", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys("^+w", True)

end if
Next i

End Sub
 
Çözüm
C++:
Sub mesaj_gonder()
Dim kime As String
Dim metin As String

For i = 1 To Me.ListView2.ListItems.Count
If ListView2.ListItems.Item(i).Checked = True Then

kime = Me.ListView2.ListItems(i)
metin = Me.ListView2.ListItems(i).SubItems(1)

ActiveWorkbook.FollowHyperlink Address:="WhatsApp Web"
Application.Wait (Now + TimeValue("00:00:10"))

Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys(kime, True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys("~", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys(metin, True)
Application.Wait (Now + TimeValue("00:00:03"))
Call SendKeys("~", True)
Application.Wait (Now + TimeValue("00:00:05"))

Call SendKeys("^+V", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys("~", True)
Application.Wait (Now + TimeValue("00:00:05"))
'Call SendKeys("^+w", True)

Application.SendKeys "{NUMLOCK}%s"
Application.CutCopyMode = False

End If
Next i
End Sub

Hocam 2 sorun çıktı tekli gönderimde metin msj'ını almıyordu. " Call SendKeys(metin, True) " bu kodu ekledim. mesajı atıyor sonrada Call SendKeys("~", True) bu kodu iki sefer kopyalıyor. 2 inci sorun ise çoklu seçimlerde. farklı whatsapp sayfalar açıyor. işlem yapmıyor
 
Merhaba muammercaylak78 Bulduğunuz çözüm yolunuzu paylaşırsanız forumda benzer sorunu olan kişiler için daha iyi olur.

Teşekkürler
 
Geri
Üst