Sending Data from Visio with HTTP Post

Started by DJozef87, December 27, 2011, 05:15:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJozef87

Hi Guys,

How can I send data from Visio with HTTP Post in VBA ?

I use a ShellExecute function to open a website with the default browser from Visio, and I want to send data using post method.

I know that using IE we can do this

Set xmlhttp = CreateObject("microsoft.xmlhttp")

    With xmlhttp
        .Open "POST", " http://myURL/", False
        .setrequestheader "Content-Type", "application/x-www-form-urlencoded"
        .send Data
        Debug.Print .responsetext
    End With


but I actually open my default browser (Firefox) with this function

BrowserOpen("http://myURL")

Function BrowserOpen(sURL As String) As Boolean
  Dim lRet As Long
  lRet = ShellExecute(GetActiveWindow, vbNullString, sURL, vbNullString,vbNullString,1)
  If lRet > 32 Then
        BrowserOpen = True
  Else
        BrowserOpen = False
        Debug.Print "Error Number: " & Err.LastDllError
  End If
End Function

Thanks in advance