vba - 使用 VBA 在whatsapp web 中发送图像
问题描述
有人知道如何使用 VBA 在 whatsapp 网络对话中添加图片吗?最好不要作为附件,而是直接在邮件中。
我已经达到了代码让我打开whatsapp web url,找到我想向其发送消息并将光标放在消息框中的联系人的地步,但我还不知道如何粘贴我复制的图像,甚至如何在我的机器中附加图片。
由于我要粘贴和发送的图像是一些工作表单元格的打印,所以当我编写代码以使其运行“ctrl v”时,它会粘贴为文本,而不是我想要的图像。
到目前为止我的代码:
Sub Send_whats()
Sheets("Current summary").Select
Dim text As String
Dim contact As String
text = "Hi! Here goes a summary of your order"
contact = Cells(6, 3)
If contact = "" Then
MsgBox "Attention, contact is blank!"
Exit Sub
End If
Range("A1:H26").Copy
ActiveWorkbook.FollowHyperlink Address:="https://web.whatsapp.com/"
Application.Wait (Now + TimeValue("0:00:07"))
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("0:00:05"))
Call SendKeys(contact, True)
Application.Wait (Now + TimeValue("0:00:03"))
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("0:00:02"))
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("0:00:02"))
Call SendKeys("{TAB}", True)
Application.Wait (Now + TimeValue("0:00:03"))
Call SendKeys("^(V)", True) 'here is where it goes wrong!
Application.Wait (Now + TimeValue("0:00:03"))
Call SendKeys(text, True)
Application.Wait (Now + TimeValue("0:00:03"))
Call SendKeys("Enter", True)
End Sub
我很感激任何帮助!谢谢!
解决方案
推荐阅读
- entity-framework - 删除的列和索引在迁移期间不断重新添加自身
- asp.net-mvc - Datepicker 不显示日期,它显示日期和时间
- postgresql - 无法使用 node-postgres 连接到 Cloud SQL
- asp.net - aspx TextBox 不显示 html 字符
- windows-10 - 网站发布 XmlSerializers System.BadImageFormatException
- php - 如何修复 AddEmbeddedImage?
- python - 我无法让我的 3 DOF 自行车模型工作
- javascript - HTML + Jquery 动态添加引导下拉菜单
- c# - 使用 dotnetbar 时挂断系统
- c - 链表中的排序插入程序