General discussion

Locked

Converting HTML file tree into Word

By Diamond Dan ·
Hi,
I need to convert a directory tree of HTML files to one large MS Word document, keeping chapters, links, and graphics intact. Is there an obscure feature of MS Word that will allow this to be done?
If not, is there a program available that can do this without a whole lot of "cut and paste" ?

If you need more info to answer this question, please contact me.

Thanks for your help,

Daniel Ahrens
danielahrens@fortna.com

This conversation is currently closed to new comments.

14 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Converting HTML file tree into Word

by Ann777 In reply to Converting HTML file tree ...

What you need is a scrolling screen shot program. I use SnagIt... and it works very well (even though my purchased version is outdated).

You can download this shareware from www.download.com -- it'll work for 45 days -- to purchase is $40.00.

Collapse -

Converting HTML file tree into Word

by Ann777 In reply to Converting HTML file tree ...

You will need to capture the pages from your web browser and then take the capture and insert them into MS Word. It works great for putting together instructions with examples!

Collapse -

Converting HTML file tree into Word

by Shanghai Sam In reply to Converting HTML file tree ...

Anna777 - I appreciate your input, however, as I stated in my question, I need to preserve links and I don't want to do all cut and paste. I trialed SnagIt, and while it was a great program in itself, it saves the HTML pages as a graphic, which doesnot preserve the hyperlinks. Also, using the method you suggested would essentially be the same as "cut and paste".

Thanks for the suggestion, but unfortunatley it's not what I'm looking for.

Regards,
Daniel

Collapse -

Converting HTML file tree into Word

by Raffi_ In reply to Converting HTML file tree ...

Hello Dan. I'm afraid your options here are a little limited.

If this is something you need to accomplish on a regular basis with this "tree" you should examine the Word on-line help regarding Master Documents & Subdocuments.

For the first 'go-round' you will probably have to cut'n'paste or drag'n'drop

Sorry the news wasn't better . . .

Regards
Raffi_

Collapse -

Converting HTML file tree into Word

by Diamond Dan In reply to Converting HTML file tree ...

Raffi - Thanks for looking into the problem, your time is appreciated, however I am still at square one with the ol' "cut n' paste". I will do this if necessary, but I am holding out for a better mousetrap. I'm sure that it's out there.

-Daniel

Collapse -

Converting HTML file tree into Word

by Peyison In reply to Converting HTML file tree ...

Dan,

This actually shouldn't be that hard to do using VBA. Instead of cutting and pasting, you can do an Insert -> File... to bring in each HTML file. This will keep the links and graphics intact. I'm not sure what you mean by chapters, but you can insert a page break or section break for each HTML file, or for each sub-directory in your tree.

The VBA code would loop through each subdirectory in the tree and "Insert -> File" each HTML file it finds.

If this is a route you're interestedin, let me know and I can post the code to do this.

Collapse -

Converting HTML file tree into Word

by Diamond Dan In reply to Converting HTML file tree ...

Peyison - First off - don't believe the rating of unacceptable. I found your input quite thought provoking, however to post a reply and to keep the question open I had to make it unacceptable. Sorry.

I would be interested in seeing the code. One question though, how can I ensure that the script pulls the files into the document in the correct order, as these are not organized alphabetically or chronologically? Also, wouldn't the links have to be converted into bookmarks for them to work? At any rate, I think that you are on the right track. Please post the code. Thanks for your input.

Regards,
Daniel

Collapse -

Converting HTML file tree into Word

by Peyison In reply to Converting HTML file tree ...

Daniel,

I didn't consider that the links would link to other pages being imported. This makes things a little more complicated, but it is still doable. You're right - you'd probably want to create a bookmark for each page. You'd then have to convert the links (which become Field Codes in Word) so that they point to the bookmark instead of the HTML page.

As far as file order, maybe the best thing to do then is to create a text file that has the files and directories to import in the properorder. The VBA code could then use this file when importing.

Two other things come to mind:

1) It would be best if none of the files had the same name (e.g. different directory, same name). You'd probably want to use the filename as the bookmark name, so the filenames should be unique.

2) It would make things a lot easier if none of the links were to HTML bookmarks in the same page, or other pages. That is, all the HTML links are just links to pages. Each page that is imported would only have one bookmark.

Let me know what you think, and then I'll put some code together.

Collapse -

Converting HTML file tree into Word

by Diamond Dan In reply to Converting HTML file tree ...

.

Peyison,

Sorry that TechRepublic makes it hard to successfully carry on a dialogue. I tried to post a comment to the discussion without rating your answer, but it was placed at the top of the page, directly under my original post.

-Dan

Collapse -

Converting HTML file tree into Word

by Diamond Dan In reply to Converting HTML file tree ...

Peyison,

The conversion of links to bookmarks can be done without too much trouble, and a text file that contains the file order already exists, albiet in a crude fashion, but it can be reworked rather easily.

To my knowledge, no 2 files have the same name, so unique naming is accomplished.

Some of the HTML pages have links to full screen graphics at the bottom of the same page, but the pages that have this are few. Not a problem here.

It looks like all of the issues thus far are minor. I think that I can definitely work with the constraints of the code. The biggest issue that I had was the raw importation of all of the files in the correct order without a lot of leg work, and it looks like you have that issue in hand.

Thanks, look forward to seeing the code.

Back to Software Forum
14 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums