how to open a word file from a URL
Hi everybody
How can I open a word file from a given url directly
can I make some changes for code below to do that
Code:
Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles Button1.Click
' PictureBox1.Image = webDownloadword("http://www.somewebsite.com/image.jpg", True, "C:\temp.jpg")
End Sub
Public Function webDownloadword(ByVal Url As String, Optional ByVal saveFile As Boolean = False, Optional ByVal location As String = "C:\") As Image
Dim webClient As New System.Net.WebClient
Dim bytes() As Byte = webClient.DownloadData(Url)
Dim stream As New IO.MemoryStream(bytes)
If saveFile Then My.Computer.FileSystem.WriteAllBytes(location, bytes, False)
Return New System.Drawing.Bitmap(stream)
End Function
Thank you
Re: how to open a word file from a URL
try API method shellexecute "open", url
should open any doc type file in default application, normally word if installed
plenty of examples in this forum