How to save shapes/images from word doc to a file *.JPEG/BMP? and how to get text in one section/page in word doc?
i have done with this code for save shapes/images from word doc to file JPEG/BMP, but it's fail
THE CODES:
wrdDoc = New Word.Document
wrdApp = New Word.Application
Try
wrdApp.Visible = True
wrdDoc = wrdApp.Documents.Open("")
wrdDoc.Activate()
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
'wrdDoc.Close()
End Try
For sh = 1 To wrdDoc.Shapes.Count
If wrdDoc.Shapes.Item(sh).Type = Microsoft.Office.Core.MsoShapeType.msoAutoShape Then
MessageBox.Show(wrdDoc.Shapes.Item(sh).Name)
Dim mstream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim bitmap As System.Drawing.Bitmap
wrdDoc.InlineShapes.Item(sh).Range.CopyAsPicture()
bitmap = wrdDoc.InlineShapes.Item(sh).Range.Paste
bitmap.Save(mstream, System.Drawing.Imaging.ImageFormat.Bmp)
Dim mbr As System.IO.BinaryReader = New System.IO.BinaryReader(mstream)
Dim buffer(mstream.Length) As Byte
mbr.Read(buffer, 0, CInt(mstream.Length))
End If
Next