Bom dia,
O código corre bem só que abre o seguinte link
- Código:
https://api.whatsapp.com/send?phone=919177019text=%22OLA%22
tenho que ativar alguma coisa para que a mensagem siga de forma automática ?
obrigado
https://api.whatsapp.com/send?phone=919177019text=%22OLA%22
dim contacts, textEnviar as text
contacts = 5531996598767
textEnviar = Ola%20isso%20e%20um%20teste
https://api.whatsapp.com/send?phone=" & Contatcs & "&text=" & textEnviar
'texto ao ser enviado, os espaços são substituidos por %20
textEnviar = Replace(msgZap, " ", "%20")
linkZap = "https://api.whatsapp.com/send?phone=" & contatoZap & "&text=" & textEnviar
Application.FollowHyperlink linkZap
'Pagina 1
Sleep (5000)
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
'SendKeys " ", True
'faz uma espera de 15 segundos para o navegador
'carregar a conversa com o contato e apos isso
'apertar o botao enter
Sleep (15000)
SendKeys "{ENTER}", True
Sleep (2000)
'aqui seria para fechar a guia do chrome
'mas nao esta funcionando, quem achar uma solucao compartilha ai
'SendKeys ("^w")
'Sleep (2000)
SendKeys ("^w")
Sleep (2000)
Dim TextEnviar, LinkZap
'texto ao ser enviado, os espaços são substituidos por %20
TextEnviar = Replace(Me.texto.Caption, " ", "%20")
'LinkZap = "https://api.whatsapp.com/send?phone=" & Me.MZap.Value & "&text=" & TextEnviar
LinkZap = "https://api.whatsapp.com/send?l=pt_br&phone=55" & Me.Zap.Value & "&text=" & TextEnviar
Application.FollowHyperlink LinkZap
'Pagina 1
Sleep (5000)
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
'SendKeys " ", True
'faz uma espera de 15 segundos para o navegador
'carregar a conversa com o contato e apos isso
'apertar o botao enter
Sleep (15000)
SendKeys "{ENTER}", True
Sleep (2000)
'aqui seria para fechar a guia do chrome
'mas nao esta funcionando, quem achar uma solucao compartilha ai
'SendKeys ("^w")
'SendKeys ("^{F4}")
'Sleep (2000)
If Me.Ref = 2 Then
DoCmd.OpenReport "rel_Recibo_Venda_PDV", acViewPreview
If Me.zap2 > 0 Then
Me!MZap2.Value = Replace(Replace(Replace(Replace(Me!MZap2.Value, " ", ""), "-", ""), "(", ""), ")", "")
FollowHyperlink "https://api.whatsapp.com/send?l=pt_br&phone=55" & Me.MZap2.Value
Else
Me!MZap.Value = Replace(Replace(Replace(Replace(Me!Zap.Value, " ", ""), "-", ""), "(", ""), ")", "")
FollowHyperlink "https://api.whatsapp.com/send?l=pt_br&phone=55" & Me.MZap.Value
End If
Option Compare Database
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub imprimir_Click()
Dim TextEnviar, LinkZap
'texto ao ser enviado, os espaços são substituidos por %20
TextEnviar = Replace(Me.texto.Caption, " ", "%20")
If Me.Ref = 2 Then
DoCmd.OpenReport "rel_Recibo_Venda_PDV", acViewPreview
If Me.zap2 > 0 Then
Me!MZap2.Value = Replace(Replace(Replace(Replace(Me!MZap2.Value, " ", ""), "-", ""), "(", ""), ")", "")
FollowHyperlink "https://api.whatsapp.com/send?l=pt_br&phone=55" & Me.MZap2.Value
Else
Me!Zap.Value = Replace(Replace(Replace(Replace(Me!Zap.Value, " ", ""), "-", ""), "(", ""), ")", "")
FollowHyperlink "https://api.whatsapp.com/send?l=pt_br&phone=55" & Me.Zap.Value & "&text=" & TextEnviar '
Sleep (5000) 'aguarda carregar
SendKeys "{TAB}", True 'tab1
SendKeys "{TAB}", True 'tab2
SendKeys "{ENTER}", True 'enter
Sleep (15000) '15 segundos pra carregar
SendKeys "{ENTER}", True 'enter
End If
Else
MsgBox "Preparar mandar por Email"
'https://www.usandoaccess.com.br/tutoriais/gerar-relatorios-em-pdf-e-enviar-por-email.asp
Dim strArquivo As String
Dim strLocal As String
strArquivo = "Recibo" & Me!Recibo & ".pdf"
strLocal = CurrentProject.Path & "\Som\Envio\" & strArquivo
'Abre o relatório devidamente filtrado e oculto
DoCmd.OpenReport "rel_Recibo_Venda_PDV", acViewPreview, , "idVenda=" & Me!Recibo, acHidden
'Gera arquivo pdf do relatório previamente aberto e filtrado.
DoCmd.OutputTo acOutputReport, "rel_Recibo_Venda_PDV", acFormatPDF, strLocal
'Fecha o relatório
DoCmd.Close acReport, "rel_Recibo_Venda_PDV"
Call enviapedido
Kill "C:\Gerencia\SysVendas\Som\Envio\" & strArquivo
End If
CurrentDb.Execute "Delete * from Tbl_Recibo WHERE Recibo =" & Me.Recibo
Lista29.Requery
Me.imprimir.Visible = False
Me.email.Enabled = False
Me.zap2.Enabled = False
Me.zap2.Visible = False
Me.Rótulo21.Visible = False
Me.Nome = Null
Me.Zap = Null
Me.zap2 = Null
Me.Recibo = Null
Me.MZap = Null
Me.MZap2 = Null
Me.email = Null
End Sub
crysostomo gosta desta mensagem
|
|