0

I'm able to send text msg from whatsapp using vb.net. Colud someone tell me how to send pdf document from vb.net. Thanks....

 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim web As New WebBrowser
            web.Navigate("whatsapp://send?phone=" & TextBox1.Text & "&text=" & TextBox2.Text.Replace(" ", "+") & "")
            ' web.Navigate("wa.me/send?phone=" & TextBox1.Text & "&attachment=" & TextBox2.Text.Replace(" ", "+") & "")
            Timer1.Start()
        Catch ex As Exception
            Timer1.Stop()
        End Try
    End Sub
    Dim sec As Integer = 0
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Sec += 1
        If sec = 10 Then
            SendKeys.Send("{ENTER}")
            Timer1.Stop()
            sec = 0
        End If
    End Sub
jhon mojes
  • 9
  • 1
  • 3
  • 2
    Not from the official api https://faq.whatsapp.com/563219570998715/?locale=en_US but you can use third party API https://blog.ultramsg.com/send-whatsapp-images-documents-using-base64/ – Martheen Jul 21 '22 at 07:03
  • Thanks for reply Is there possible to send pdf without api – jhon mojes Jul 21 '22 at 07:28
  • 1
    No, unless you want to send keys to the browser to open and add the file – Martheen Jul 21 '22 at 07:29
  • @Martheen, Could you check out this link.... https://stackoverflow.com/questions/73095517/how-can-i-use-selenium-whatsapp-send-button-elements-xpath-or-css-in-vb-net – jhon mojes Jul 24 '22 at 14:32

0 Answers0