用Js一句话实现打开QQ和客服聊天:
location.href=“tencent://message/?uin=客服QQ号”;
修改之后的代码变成这样:
Dim txt As String
If Tables("客户").Current IsNot Nothing Then
txt = Tables("客户").Current("QQ号码")
Dim str As String
If txt > ""
str = "<script Type=""text/javascript"">location.href=""tencent://message/?uin=" & txt & """</script>"
FileSys.WriteAllText("D:\data\Table.html",str, False) '将信息写入网页文件里面,保存到D盘下面.
Dim Proc As New Process '启动浏览器打开这个网页文件,运行
Proc.File = "D:\data\Table.html"
Proc.Start
'Sleep (2000)
Proc.WaitForExit '等打开程序之后退出
Else
MessageBox.show("QQ号为空,无法联系")
End If
End If