Can I use a macro to break up doc into separate files?

M

Max Moor

Hi All,
I have a long document (a user's manual) that I want to break up into
a number of separate HTML files. Ultimately, these will become my online
help (compiled HTML).

I don't know of any way to simply convert from a Word dco to a .chm
file, so I'm wondering about a macro to break the document up for me. At
least that much of the conversion will be done for me.

Each section of the doc has a number of Headings of various levels
included. Ultimately, I'd like to select all the text from each Heading 1
to the next Heading 2, or Heading 1 if no Heading 2 exists. If a Heading 2
exists, I want to select all the text from it to the next Heading 2, or
Heading one if there isn't another one.

Once the text is selected, I want to save it to an HTML file, named
whatever the Heading text is.

I know my way around Visual Basic, but know mext to nothing about
Word. Is what I want to do a reasonable thing? Is it possible that this
has been done before, and some macro code is already out there somewhere?

- Max
 
A

Anand.V.V.N

Hi Max,

This is not unreasonable at all I guess.
Since you know your way around VB, you can make this in VB itself. Every
sentence has formating information, you can write a loop in which you'll
check the formating information of the sentence and if you reached the next
heading1 or heading 2 copy the contents and create a new file and save it as
a html file.

I hope this should give you the start you want.

I am not sure if this helped you? Hope this is what you were looking for.

Anand
 

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