boa tarde a todos
fiz um busca na internet, envio de arquivo pelo whastzapp e achei esse codigo do excel tem como inverter pra usar no access
fiz um busca na internet, envio de arquivo pelo whastzapp e achei esse codigo do excel tem como inverter pra usar no access
- Código:
Public Sub lsEnviarWhatsApp()
Dim lUltimaLinha As Long
Dim i As Long
Dim lContato As String
Dim lMensagem As String
'Abre o WhatsApp
Shell "C:\Program Files\Google\Chrome\Application\chrome.exe" & " https://web.whatsapp.com/"
Application.Wait Now + TimeValue("00:00:15")
lUltimaLinha = WhatsApp.Cells(WhatsApp.Rows.Count, 2).End(xlUp).Row
'Faz o loop pelas linhas da tabela
For i = 7 To lUltimaLinha
If WhatsApp.Cells(i, 4).Value = "" Then
lContato = WhatsApp.Cells(i, 2).Value
lMensagem = WhatsApp.Cells(i, 3).Value
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
Application.Wait Now + TimeValue("00:00:02")
SendKeys lContato
Application.Wait Now + TimeValue("00:00:02")
SendKeys "~"
Application.Wait Now + TimeValue("00:00:02")
SendKeys lMensagem
SendKeys "~"
'Arquivo
SendKeys ("+{Tab}")
SendKeys "~"
Application.Wait Now + TimeValue("00:00:0005")
SendKeys ("{UP}")
SendKeys ("{UP}")
SendKeys ("{UP}")
SendKeys ("{UP}")
SendKeys "~"
Application.Wait Now + TimeValue("00:00:0005")
Application.SendKeys WhatsApp.Range("arquivoenvio").Value
SendKeys "~"
Application.Wait Now + TimeValue("00:00:0005")
SendKeys "~"
'Imagem
WhatsApp.Range("Imagem01").CopyPicture , xlBitmap
Application.Wait Now + TimeValue("00:00:03")
SendKeys "^v"
Application.Wait Now + TimeValue("00:00:01")
SendKeys "~"
Application.Wait Now + TimeValue("00:00:02")
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
WhatsApp.Cells(i, 4).Value = Now
End If
Next i
MsgBox "Mensagens enviadas!"
End Sub
Sub SelecionarArquivo()
Dim arquivo As Variant
arquivo = Application.GetOpenFilename()
If arquivo <> False Then
WhatsApp.Range("arquivoenvio").Value = arquivo
End If
End Sub