processing multiple word files to save as html

T

Tony Logan

Is there a way I can open multiple Word documents in a folder (C:\WordDocs\input, for example), save them as Compact HTML (I've downloaded MSFilter.dot), then save the resulting HTML files in a different folder (C:\WordDocs\output, for example)?

I tried using the Batch Conversion Wizard (File > New, then "Other Documents" tab, then selecting "Batch Conversion Wizard, but I don't have access to it. Plus I'm on a network, and don't know if/when I can get this feature installed, so finding an alternative is probably going to be my fastest solution.

Thanks.
 
J

Jonathan West

Hi Terry,

If you have done a full install of Office, you will find the Batch
Conversion Wizard under the Other Documents tab of the File New dialog. That
will do the conversion from doc to HTML. Then you use the Office HTML filter
application to strip the excess junk out of the HTML files.

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

Tony Logan said:
Is there a way I can open multiple Word documents in a folder
(C:\WordDocs\input, for example), save them as Compact HTML (I've downloaded
MSFilter.dot), then save the resulting HTML files in a different folder
(C:\WordDocs\output, for example)?
I tried using the Batch Conversion Wizard (File > New, then "Other
Documents" tab, then selecting "Batch Conversion Wizard, but I don't have
access to it. Plus I'm on a network, and don't know if/when I can get this
feature installed, so finding an alternative is probably going to be my
fastest solution.
 
J

Jonathan West

Hi Tony,

Well, if you aren't able to use what is there already, you'll have to code
it for yourself. You are letting yourself in for more work than is strictly
necessary, duplicating something which is already there, but that is your
business :)

These articles will help you work out how to get all the files in a folder

Find & ReplaceAll on a batch of documents in the same folder
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

Insert into a document the names of all files in a selected folder
http://word.mvps.org/FAQs/MacrosVBA/InsertFileNames.htm

Once you have the filenames, it's not that hard to open each in turn, and
use the SaveAs method to save to HTML and to a different folder.

Then, since you are presumably using Word 2000, you will need to call the
HTML 2.0 converter as a separate process to clean up the HTML files. The
following article describes how to use the converter from VBA.

HOWTO: Programmatically Use the HTML Filter DLL to Save Word Documents as
Plain HTML
http://support.microsoft.com/default.aspx?scid=291325

I would recommend you run the process as a batch rather then cleaning each
one immediately after saving it as HTML. This will give more time for any
separate disk-writing processes to be completed and for the HTML files to be
fully closed before they have to be opened again.

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup



Tony Logan said:
Thanks for the response, Jonathan. However, I don't have access to the
Batch Conversion Wizard, and getting access to it would require a full
system re-install, something I don't want to do right now (long story).
Which is why I was searching for a workaround to using the Batch Conversion
Wizard. I haven't yet found anything online or in the VBA help files that
gets close enough to duplicating what I want to do for me to hit upon a
solution. To summarize, I'd like to do the following steps with a single
macro (if possible):
1. Identify all Word docs in a certain folder (C:\input, say).
2. Convert all of these to HTML, then Export to Compact HTML. Maybe this
can be done as 1 step, or maybe it needs to be two separate steps...I'm not
sure.
3. Save all the resulting HTML files to another folder (C:\output, say).

Lastly, is there any way possible to further automate step 1, so that
rather than depend on a user firing up a macro, the macro would
automatically run anytime files were placed in the input folder?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top