Problem Opening large HTML file in Word using VBA 
Author Message
 Problem Opening large HTML file in Word using VBA

I am creating a Word 2000 object and then opening a large
html file with it.  I then save this file as a Word
document.  The problem I have is that most of the time I
do not get all the information in the Word document that I
am expecting.  I cuts off some information at the bottom
of the page.  It is not consistent where it cuts off the
information.  I have confirmed that the html file is
complete before it is being opened and saved in Word.  
Here is a few lines of my code:

dim oWord as Word.Application
Set oWord = CreateObject("Word.Application")
oWord.Documents.Open ("largefile.htm")
oWord.ActiveDocument.PageSetup.LeftMargin = "36"
oWord.ActiveDocument.PageSetup.RightMargin= "36"
oWord.ActiveDocument.PageSetup.TopMargin= "36"
oWord.ActiveDocument.PageSetup.BottomMargin= "36"
oWord.ActiveDocument.SaveAs "largefile.doc"
oWord.ActiveDocument.Close
oWord.Quit
Set oWord = Nothing

Any help would be greatly appreciated.

Jeff Radke



Sun, 27 Feb 2005 00:40:38 GMT  
 Problem Opening large HTML file in Word using VBA
Hi Jeff,

Answered in microsoft.public.word.vba.general

From the MS Word MVP site:
'=====================================
Avoid posting to more than one newsgroup. It is very unusual for it to be
necessary to get half the answer from each of two different groups. If you
feel you *must* post your message to multiple groups, please include the
names of all the groups in the header for a single message, rather than
posting separate messages to each group. This makes it easier for you and
everyone else to keep track of who has replied to the question. It is a real
annoyance to those who answer to spend an hour on a question only to find
someone has already answered it in another group.
'=====================================


Quote:
> I am creating a Word 2000 object and then opening a large
> html file with it.  I then save this file as a Word
> document.  The problem I have is that most of the time I
> do not get all the information in the Word document that I
> am expecting.  I cuts off some information at the bottom
> of the page.  It is not consistent where it cuts off the
> information.  I have confirmed that the html file is
> complete before it is being opened and saved in Word.
> Here is a few lines of my code:

> dim oWord as Word.Application
> Set oWord = CreateObject("Word.Application")
> oWord.Documents.Open ("largefile.htm")
> oWord.ActiveDocument.PageSetup.LeftMargin = "36"
> oWord.ActiveDocument.PageSetup.RightMargin= "36"
> oWord.ActiveDocument.PageSetup.TopMargin= "36"
> oWord.ActiveDocument.PageSetup.BottomMargin= "36"
> oWord.ActiveDocument.SaveAs "largefile.doc"
> oWord.ActiveDocument.Close
> oWord.Quit
> Set oWord = Nothing

> Any help would be greatly appreciated.

> Jeff Radke



Mon, 28 Feb 2005 03:31:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem Opening large HTML file in Word using VBA

2. Using VBA Automation to Open Word at the File Open Locatiion

3. using word to open an html file and save it as .doc

4. Problem opening text file from VBA in Word XP

5. Sharing problem writing to MDB file using WORD VBA code

6. copy HTML into WORD document using VBA

7. Q: Using Word-HTML features with VBA

8. How to open HTML file from VB6 code and let this HTML file show up

9. How to open HTML file from VB6 code and make this HTML file show up

10. Open Word from Access Using VBA....

11. Word freezes trying to run macro or open vba using Alt-F11

12. Opening Word using Excel VBA

 

 
Powered by phpBB® Forum Software