gsilvey
09-15-2004, 11:59 AM
Is there a way to insert a Bitmap into a Word Document? I am working with Word.Document, and can insert and replace text. Can this be done with a Bitmap?
Also, does anyone know where the Word COM API is documented. Some sort of reference type guide?
Thanks!
Mike Rosenblum
09-15-2004, 01:57 PM
The following is a good Word resource for a .Net developer: Word Object Model from a .NET Developer's Perspective (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/WordObject.asp).
However, as for inserting Bitmaps into Word, I don't personally know. Have you tried Word's Macro Recorder for starters?
gsilvey
09-16-2004, 05:51 AM
Thank for the link. I have been looking over MS's MSDS online documentation. If would be nice if it was indexed or searchable, or had more descriptive samples.
Anyway, I got it working using Shapes.AddPicture, but that requires me to write the Bitmap to disk, then make the call. It works, but it appears to be overlapping the text that is already in the document.
I'm going to continue scanning through the MSDN stuff to figure this out...
The following is a good Word resource for a .Net developer: Word Object Model from a .NET Developer's Perspective (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/WordObject.asp).
However, as for inserting Bitmaps into Word, I don't personally know. Have you tried Word's Macro Recorder for starters?
Mike Rosenblum
09-16-2004, 09:05 AM
You could post your question in the VBA Office Integration Forum (http://www.xtremevbtalk.com/forumdisplay.php?f=14). You should be able to get more Word help in there. When you get your solution, translating it to .Net should be a snap...
gsilvey
09-16-2004, 11:27 AM
For anyone interested, take your bitmap object, paste it to the clipboard, set a Range in the Document, then to a Range.Paste().
Clipboard.SetDataObject(Bitmap, False)
set Range to something...
Range.Paste()