Ultimately I want to upload a file to a sharepoint document library. This looks extremely easy and trivial but I haven't written any VB in about 10 years, so it's kicking my strASS

I have tried looking into using the web services for this, but all of the solutions posted are incomplete, so I've punted and gone after the http put methods.

I found this vbscript which works very well, tested on files up to 23MB and it works great.

--snip--
'Use this function call to upload a single file
WebUploadFile "C:\filename.any", "http://server/library/filename.any", "domain\user", "password"

'====================== WebDAV upload single file
Function WebUploadFile (file, url, user, pass)
Dim objXMLHTTP
Dim objADOStream
Dim arrbuffer
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1
objADOStream.LoadFromFile file
arrbuffer = objADOStream.Read()
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objXMLHTTP.open "PUT", url, False, user, pass
objXMLHTTP.send arrbuffer
End Function

--snip--

I have been trying to convert this to some kind of VB2008 and I've gotten to here:

--snip--
Module SharePointPutTestFunctions
Function WebUploadFile(ByVal file As String, ByVal url As String, ByVal user As String, ByVal pass As String) As String
Dim objXMLHTTP
Dim objADOStream
Dim arrbuffer As Object
Dim strresponse
objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open()
objADOStream.Type = 1
objADOStream.LoadFromFile(file)
arrbuffer = objADOStream.Read()
objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
strresponse = objXMLHTTP.open("PUT", url, False, user, pass)
strresponse = objXMLHTTP.send(arrbuffer)
MsgBox(strresponse)
WebUploadFile = "Success - maybe...no real error trapping in here currently, just a return value to be complete"
End Function
End Module
--snip--

(feel free to giggle at my 'back in the day' tendencies with VB, I'm just trying to get the error list box to shut up ).

In any case, this works (or seems to work) but the files are always 0bytes. I'm assuming there is something about how these variables are automatically typed in vbs that I need to be explicit about in VB2008.

Any guidance or links appreciated - if anyone has some pretty clear examples or links about doing this with the web-service that would be better, but I'll take what I can get.

Many thanks!

Bif