اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

السلام عليكم

لدي ملف اكسيل فورم ل ارساله سائل نصية الكود يعمل بشكل صحيح ولكن لا يتم لص نص الرساله

ارجو المساعدة 

Private Sub CommandButton1_Click()
    Dim contact As String
    Dim text As String

    '
    contact = TextBox1.Value
    text = TextBox2.Value

    '  Google Messages
    ActiveWorkbook.FollowHyperlink Address:="https://messages.google.com"
    Application.Wait (Now + TimeValue("00:00:10"))

    '
    Call SendKeys("{TAB}", True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys("{TAB}", True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys("~", True) ' Enter key
    Application.Wait (Now + TimeValue("00:00:04"))
    
    '
    Call SendKeys(contact, True)
    Application.Wait (Now + TimeValue("00:00:04"))
    
    '
    Call SendKeys("{TAB}", True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys(text, True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys("~", True) ' Enter key
    Application.Wait (Now + TimeValue("00:00:04"))
End Sub

 

sms.xlsm

  • أفضل إجابة
قام بنشر

جرب هذا الكود المختصر بإذن الله يكون هو المطلوب

Private Sub CommandButton1_Click()
    Dim contact As String, mytext As String

    contact = TextBox1.Value
    mytext = TextBox2.Value

    '  Google Messages
    ActiveWorkbook.FollowHyperlink Address:="https://messages.google.com/web/conversations/new"
    Application.Wait (Now + TimeValue("00:00:10"))

    Call SendKeys(contact, True)
    Application.Wait (Now + TimeValue("00:00:04"))
    Call SendKeys("{TAB}", True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys("~", True) ' Enter key
    Application.Wait (Now + TimeValue("00:00:04"))
    
    Call SendKeys(mytext, True)
    Application.Wait (Now + TimeValue("00:00:01"))
    Call SendKeys("~", True) ' Enter key
    Application.Wait (Now + TimeValue("00:00:04"))
    
    MsgBox "Done by mr-mas.com"
End Sub

بالتوفيق

  • Like 3

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information