Hello friends,
I've been asked to convert about 700+ word files into Word HTML. As you know, the word document with HTML as its extension. Yes, you guessed it right, Save As HTML.
I created a macro which saves a word document as HTML with the current file name and then closes it. Got this after some online research. This works great with a single open document. I need to automate it for all the 700 docs. I planned to open the word docs and call the macro using a batch or vbscript.
Tried batch first. The batch i created opens just one word document, saves it as html and closes it. Then it opens a new word document, and not the files in the directory. Failed! I have the batch script at office, if you need it for reference, pls tell me. I will post it.
Tried a vb script, but dont know how to add a variable to run it on all word docs in a directory structure, one by one. Here is the code:
This will run the macro in word for Test.doc. I have many folders and subfolders, inside the folder 'Test', and many word docs in each. I want the batch or script to open each word doc, and run the macro, one by one. The macro will close each doc.Code:Dim objSaveAs Set objSaveAs = CreateObject("Word.Application") on error resume next With objSaveAs .documents.Open (“D:\Test\Test.doc”) .Run "Macro1" .Quit End With Set objSaveAs = Nothing
Please help. I know we have many smart techies here. Thanks in advance.
Bookmarks