Click here to Skip to main content
16,010,470 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: load order Pin
Dave Kreskowiak27-Jun-05 10:28
mveDave Kreskowiak27-Jun-05 10:28 
GeneralRe: load order Pin
btoyer28-Jun-05 4:22
btoyer28-Jun-05 4:22 
Generalerror Pin
fatidarya27-Jun-05 8:54
fatidarya27-Jun-05 8:54 
GeneralRe: error Pin
Dave Kreskowiak27-Jun-05 9:09
mveDave Kreskowiak27-Jun-05 9:09 
GeneralRe: error Pin
StylezHouse27-Jun-05 9:11
StylezHouse27-Jun-05 9:11 
Generalcomplex mapping printers Pin
fozz7527-Jun-05 5:51
fozz7527-Jun-05 5:51 
GeneralRe: complex mapping printers Pin
Dave Kreskowiak27-Jun-05 8:59
mveDave Kreskowiak27-Jun-05 8:59 
GeneralExporting Images From Word Pin
ironclads27-Jun-05 5:30
ironclads27-Jun-05 5:30 
Ok, I know what you are thinking. Why was this posted on the VB.Net forum? Well, let me explain.

I Have a DHTML text editor that I currently import Microsoft Word documents into via IE. The only problem is only text comes across currently. I came across info on MSDN that said images can be saved out of Word 2003 as bmp files. So far I can open the document, get a handle on each image, and copy them to the clipboard, but for some odd reason, probably my fault , I can't seem to save them to the hard drive.

I've included the code below, perhaps you can assist, especially if you know MS VB.NET and VBScript better than I, which wouldn't be difficult to do. Basically I get the image copied to the clipboard fine but then I don't seem to be saving anything out. Nothing fails, it just doesn't save. Any help would be greatly appreciated.

Sub ImportWordDoc()
On Error Resume Next
Set wApp = CreateObject("Word.Application")
wApp.Activate
wApp.WindowState=0
call wApp.Resize(400, 400)
Set wDoc = wApp.Documents.Open(document.all.FileToOpen.value)
wApp.Visible = true

For index = 1 To wDoc.InlineShapes.Count
inlineShape = ""
Set inlineShape = wApp.ActiveDocument.InlineShapes(index)
inlineShape.Select()
wApp.Selection.CopyAsPicture()
data = ""
Set data = Clipboard.GetDataObject()
If data.GetDataPresent( GetType( System.Drawing.Bitmap )) Then
bmp = ""
bmp = CType(data.GetData(GetType(System.Drawing.Image)), Bitmap)
bmp.Save( "C:\mybitmap" + cstr(index) + ".bmp" )
End If
Next
Call wDoc.Close(True)
call wApp.Quit(True)
End Sub

Any help or suggestions would be greatly appreciated.

Tim
GeneralRe: Exporting Images From Word Pin
Dave Kreskowiak27-Jun-05 9:03
mveDave Kreskowiak27-Jun-05 9:03 
GeneralRe: Exporting Images From Word Pin
ironclads27-Jun-05 13:11
ironclads27-Jun-05 13:11 
GeneralPictureBox: Open Image in default viewer Pin
Brad Fackrell27-Jun-05 4:14
Brad Fackrell27-Jun-05 4:14 
GeneralRe: PictureBox: Open Image in default viewer Pin
Dave Kreskowiak27-Jun-05 9:15
mveDave Kreskowiak27-Jun-05 9:15 
GeneralRe: PictureBox: Open Image in default viewer Pin
Brad Fackrell27-Jun-05 10:32
Brad Fackrell27-Jun-05 10:32 
GeneralRe: PictureBox: Open Image in default viewer Pin
Dave Kreskowiak27-Jun-05 11:57
mveDave Kreskowiak27-Jun-05 11:57 
GeneralRe: PictureBox: Open Image in default viewer Pin
Brad Fackrell27-Jun-05 11:58
Brad Fackrell27-Jun-05 11:58 
Generali want add combobox.item Pin
Attawat27-Jun-05 2:39
Attawat27-Jun-05 2:39 
GeneralRe: i want add combobox.item Pin
WillemM27-Jun-05 8:45
WillemM27-Jun-05 8:45 
GeneralDATA REPORT Pin
rngoyal27-Jun-05 1:17
rngoyal27-Jun-05 1:17 
GeneralSoapMapper:Restoring data into SoapMapper USR_RECORDING failed HRESULT=0x80070057: The parameter is incorrect. Pin
Nasir_mna27-Jun-05 0:39
Nasir_mna27-Jun-05 0:39 
GeneralCrystal Reports(.NET) forum Pin
Madni Abbasi26-Jun-05 23:53
Madni Abbasi26-Jun-05 23:53 
GeneralHelp me out Pin
kpr_psna26-Jun-05 23:50
kpr_psna26-Jun-05 23:50 
GeneralRe: Help me out Pin
Dave Kreskowiak27-Jun-05 1:03
mveDave Kreskowiak27-Jun-05 1:03 
GeneralRe: Help me out Pin
WillemM27-Jun-05 8:49
WillemM27-Jun-05 8:49 
GeneralAutomation of Excel through Vb.net Pin
mian rashed26-Jun-05 23:37
mian rashed26-Jun-05 23:37 
GeneralRe: Automation of Excel through Vb.net Pin
ironclads27-Jun-05 5:45
ironclads27-Jun-05 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.