Image to Word

If it's a project you're creating, your "resources" point to individual files on your hard disk. You should be able to import those into Word.
If you only have access to the files as "resources", you could make a picture box of the appropriate dimensions and put the image in that. One printscreen and a bit of image editting later, and you can save it as a file.
 
Simplest is to copy the resource to clipboard with Clipboard.SetImage method, then use the Range.Paste method in Word.
Ehsanit said:
If it's a project you're creating, your "resources" point to individual files on your hard disk.
Resources are compiled into assembly, referring to project source files at runtime is pointless.
 
Resources are compiled into assembly, referring to project source files at runtime is pointless.

Unless he wanted to make the word file from his development machine, such as when making the documentation for the project. In that case writing a program, even in the high level .net environment, that just copies a file to the clipboard is rather pointless when word can have direct access to the file.

It would be faster than the graphics editting alternative though. I wish I'd thought of that.
 
'So,I am beginner and I dont know how to finish a code.

Dim WordApp As Word.Application = CreateObject("Word.Application")

Dim WordDoc As Word.Document = WordApp.Documents.Add()
WordApp.Visible = True

Dim objWdRange As Word.Range
Dim GraphImage As System.Drawing.Bitmap

GraphImage = My.Resources.wolf

WordApp.Visible = True
objWdRange = WordDoc.Content

With WordDoc
If WordDoc.Bookmarks.Exists("GraphImage") Then
WordDoc.Bookmarks("GraphImage").Range.InlineShapes.AddPicture(FileName:=GraphImage, LinkToFile:=False, SaveWithDocument:=True)

End If
End With
 
Ok, it seems I completely misunderstood what was being asked for here. I'll disappear into watcher mode now.
 
AddPicture method requires a file path, which means you must first save your resource to a file and then use that path. (My.Resources.wolf.Save method)
Ehsanit said:
Ok, it seems I completely misunderstood what was being asked for here. I'll disappear into watcher mode now.
This place and and everything in it is always about VB.Net development.
 
Back
Top