how can I convert a Word (2000) document into many
HTML files, i.e. each file for a chapter and also have
correct links from document index to the files.
It seem's that this is not possible with word. Does anybody
knows a external tool, which can do this.
The Task should be very common, because may pepole would like to
publish big word Dokuments in HTML. But It seem's that this is not
possible with word.
Does anybody knows a external tool, which can do this.
Frank
Not sure about the links - but the following macro was based on a macrom by
regular contrbutor to this ng Doug Robbins to split merged documents into
separate merge letters. With only a little adjustment it can be used to
split a document that is divided by sections into separate documents one per
section. You will need to change the target folder name from c:\my documents
to wherever you want to put the resulting html files. You may also need to
alter the save as options if those set do not entirely tally with what you
are doing. In the absence of anything better it may well do the trick.
Sub SplitToHTML()
' splitter Macro
' Original Macro created 16-08-98 by Doug Robbins to save each letter
created by a
' mailmerge as a separate file.
' Modified by Graham Mayor 13-06-00 to split a document divided into
sections
' at the section breaks.
Selection.EndKey Unit:=wdStory
SubDocs = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < SubDocs
DocName = "c:\My Documents\Chapter" & LTrim$(Str$(Counter))
' Modify above line to target path and filename prefix
MsgBox DocName
' Above line can be removed
ActiveDocument.Sections.First.Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.SaveAs FileName:=DocName, FileFormat:=wdFormatHTML, _
LockComments:=False, Password:="", AddToRecentFiles:=True,
WritePassword:="", _
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Counter = Counter + 1
Wend
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor <gma...@eidosnet.co.uk>
The five ages of man:
Lager.. Aga .. Viagra .. Saga .. Gaga
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
"frank hoffman" <fra...@gmx.at> wrote in message
news:8i3ic7$4m7$1...@news.rp-plus.de...
The built-in Master Document tool will do this for you. This is the ONLY
thing I use Master Documents feature for :-)
1) Take your document and ensure the headings are formatted with the
built-in styles.
2) Do a File Save As HTML. DON'T save over the original :-)
3) Now, go to Outline View. Select from the first Heading 2 to the bottom
of the document. The way this works is that Word will divide the document
at every heading of the same level as the one at the beginning of your
selection. If you want to split at Heading 1's, select a Heading 1 first.
Click "Create Subdocument".
Word will divide the document at every Heading 2. Save again as HTML and
you will see all the files dutifully saved out.
4) Now, Open each subdocument in Outline View.
5) This time, Select from the first Heading 3 to the bottom and repeat the
process. Again, Word will save out a zillion subdocuments, each beginning
with a Heading 3 and continuing to the next Heading 3.
6) You MUST work "down" the heirarchy of headings. Word will split at only
ONE heading level at a time. If you start with a lower-level heading, it
makes a hell of a mess: start again, and this time work down from the
highest heading level to the lowest. I normally only need to split at the
Heading 1s and 2s. Anything lower is getting too fiddly. But I have one
chapter where I also have to split again at the Heading 3s.
If you have a large work, save after each split or you will run Word out of
memory and it will crash.
7) Make SURE you now DISCARD the Master Document. Master Documents cannot
be edited: they're one-shot only. Create a new one each time.
If you want to strip the result to compact HTML you need to run the HTML
filter in batch mode from the command line. Run from Word, you cannot set
the option that removes the embedded style sheets, so your CSS won't work.
The HTML Filter 2 actually has a user interface: you can start it outside
Word from Start>Programs>Microsoft Office Tools>HTML Filter. But it will
only load about 20 files at once. If you end up with several hundred like I
do, you need to run the filter from the command line. Instrustions for
doing that are on the Microsoft Office website.
Let me know if you want the macro I have that does this automatically. I
use it for saving Manuals to a website.
The program designed to do this is called HTML Transit. You will find it on
the Web. It does a brilliant job, but I warn you: It's expensive and it
takes quite a while to learn to configure it.
Hope this helps.
In microsoft.public.word.docmanagement on Mon, 12 Jun 2000 22:48:54 +0200,
"frank hoffman" <fra...@gmx.at> wrote:
> Hi,
>
> how can I convert a Word (2000) document into many
> HTML files, i.e. each file for a chapter and also have
> correct links from document index to the files.
>
> It seem's that this is not possible with word. Does anybody
> knows a external tool, which can do this.
>
> The Task should be very common, because may pepole would like to
> publish big word Dokuments in HTML. But It seem's that this is not
> possible with word.
>
> Does anybody knows a external tool, which can do this.
>
> Frank
>
Please post follow-up questions to the newsgroup so that all may follow the thread.
John McGhie <jo...@mcghie-information.com.au>
Consultant Technical Writer
Microsoft MVP (Word)
Sydney, Australia (GMT +10 hrs) +61 (04) 1209 1410
Pretty slick :) MS had a macro to separate into separate docs for each page
http://support.microsoft.com/support/kb/articles/Q216/8/45.ASP but it's
certainly nice to see there's *something* we can suggest using the Master
Documents feature for <g>.
Did you use File=>Save as Web Page or (with the HTML Filter v2)
File=>Export to HTML? I only have File=>Save as HTML in Word97
(or in Word 2000 with the HTML file type in the Save As screen dropdown).
Frank - the HTML Filter 2 that John was referring to is an optional add-in for
Word 2000 available from the Word downloads section of
http://officeupdate.com/Word
===========
<<"John McGhie [MVP - Word]" <jo...@mcghie-information.com.au> wrote in message
news:8vbckskf0ot4t0bs0...@4ax.com...
Frank:
Hope this helps.>>
--
Bob Buckland ?:-) MS Office/Word MVP
*Courtesy is not expensive and can pay big dividends*
http://go.compuserve.com/MSOfficeForum?loc=U.S.
(CompuServe.com support forums are now free)
List of Microsoft Newsgroups by Product -
http://support.microsoft.com/support/news/NgProd.asp?D=9
> MS had a macro to separate into separate docs for each page
> http://support.microsoft.com/support/kb/articles/Q216/8/45.ASP
>
I don't approve of that one, anyway, because it uses the Clipboard (and
it wouldn't have to!)
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
yes, I can divide a word doc into several pieces and then save
them as HTML files. But what about the links. At least I must
have an index of the contens, which is linked to the HTML-File of
each chapter. How can I generate this ?
Frank
In microsoft.public.word.docmanagement on Tue, 13 Jun 2000 18:53:28 -0700,
"Bob Buckland ?:-\)" <7521...@compuserve.com> wrote:
> Did you use File=>Save as Web Page or (with the HTML Filter v2)
> File=>Export to HTML?
I use File>Save As Web Page while stuffing around with the master doc.
File>Export strips the HTML back. If you strip the HTML at that stage, your
master doc is utterly history :-)
I run the HTML Filter 2 in batch mode from a script to clean the embedded
style sheets out of the saved files as the last step in the publication
process before applying the FrontPage theme (from FrontPage, not Word). I
retain the XML and VML and all the Office-specific markup so I can suck the
pages back into Word from the webserver for updating.
Cheers.
Frank:
If you use the Master Doc approach, the links will be generated for you.
Generate the TOC in the Master Document before you throw it out to get a TOC
with links. Make sure you have saved all the subdocs before you generate
the TOC, or the URLs will all be blank.