我正在尝试使用带有VBA宏的Word 2013中的Webbrowser.navigate功能
我遇到问题的代码是:
Webbrowser.Navigate URL, , , myPostData, "Content-type: multipart/form-data; boundary=" + Boundary + vbCrLf
这段确切的代码在Windows 7中运行良好,但在Windows 8.1中,IE窗口立即关闭,无法处理发布请求。
Windows 8中是否有更改?我试过运行7和8.1的多台机器,只有8.1有这个问题。
编辑:这是完整的功能,我使用的URL是一个内网网址,所以我无法提供它
Sub IEPost(URL As String, FormData As String, Boundary As String)
Dim WebBrowser: Set WebBrowser = CreateObject("InternetExplorer.Application")
WebBrowser.Visible = True
MsgBox (FormData)
'Send the form data To URL As POST request
Dim bFormData() As Byte
ReDim bFormData(Len(FormData) - 1)
bFormData = StrConv(FormData, vbFromUnicode)
WebBrowser.Navigate URL, , , bFormData, "Content-Type: multipart/form-data; boundary=" + Boundary + vbCrLf
Do While WebBrowser.Busy
DoEvents
Loop
End Sub