borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Auto forward certain parts of an email)Next Topic (Help me.....it\'s urgent) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Help Me................i't urgent2
Poster Message
sunoff
Level: Scholar

Registered: 17-12-2004
Posts: 47

icon Help Me................i't urgent2

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

16-10-2005 at 05:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Help Me................i't urgent2
Previous Topic (Auto forward certain parts of an email)Next Topic (Help me.....it\'s urgent) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder