|
-
Dec 22nd, 2013, 04:19 PM
#1
Thread Starter
Lively Member
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|