B
B. Cline
Hi,
I need to write a conversion routine to split pictures out of about 10000
word documents. (Actually the text is converted to RTF, the pictures should
be converted to jpg).
I thought I could simply save the word doc as rtf and strip the picture.
That works. The problem is getting the picture to save correctly. I can use
word to determine which pictures are in the original document and can get
them to the clipboard. I can't seem to be able to paste this into a
picturebox for further processing (selecting the correct picture etc.).
Code like
If Clipboard.GetDataObject.GetDataPresent(DataFormats.Bitmap, True)
Then
Dim i As Image
i = CType(Clipboard.GetDataObject.GetData(DataFormats.Bitmap,
True), Bitmap)
PictureBox1.Image = i
End If
won't work because the framework can't identify any of the formats as a
bitmap.
The formats I am seeing are
Office Drawing Shape Format
MetaFilePict
EnhancedMetafile
PNG+Office Art
JFIF+Office Art
GIF+Office Art
PNG
JFIF
GIF
(On a different computer I also saw DIB but that was at home
Has anyone managed to do something like this? Or could someone give me a
nudge in the correct direction or group?
Thanks
Ben
I need to write a conversion routine to split pictures out of about 10000
word documents. (Actually the text is converted to RTF, the pictures should
be converted to jpg).
I thought I could simply save the word doc as rtf and strip the picture.
That works. The problem is getting the picture to save correctly. I can use
word to determine which pictures are in the original document and can get
them to the clipboard. I can't seem to be able to paste this into a
picturebox for further processing (selecting the correct picture etc.).
Code like
If Clipboard.GetDataObject.GetDataPresent(DataFormats.Bitmap, True)
Then
Dim i As Image
i = CType(Clipboard.GetDataObject.GetData(DataFormats.Bitmap,
True), Bitmap)
PictureBox1.Image = i
End If
won't work because the framework can't identify any of the formats as a
bitmap.
The formats I am seeing are
Office Drawing Shape Format
MetaFilePict
EnhancedMetafile
PNG+Office Art
JFIF+Office Art
GIF+Office Art
PNG
JFIF
GIF
(On a different computer I also saw DIB but that was at home
Has anyone managed to do something like this? Or could someone give me a
nudge in the correct direction or group?
Thanks
Ben