Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
export to multiple html files
Hi,
Is there anyway to export a word document into multiple html documents. I'd like the output document to be cut at a certain heading level. I.e each heading2 becomes the beginning of a new output file. thanks, |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
export to multiple html files
The following code in a macro should do it:
Dim i As Long Dim asection As Range Dim newdoc As Document With ActiveDocument For i = .Paragraphs.Count To 1 Step -1 If .Paragraphs(i).Style = "Heading 2" Then Set asection = .Paragraphs(i).Range asection.End = .Range.End Set newdoc = Documents.Add newdoc.Range.FormattedText = asection.FormattedText newdoc.SaveAs FileName:="Section" & i, FileFormat:=wdFormatHTML newdoc.Close asection.Delete End If Next End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "cc" wrote in message ups.com... Hi, Is there anyway to export a word document into multiple html documents. I'd like the output document to be cut at a certain heading level. I.e each heading2 becomes the beginning of a new output file. thanks, |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I export to HTML in Word 2007? | Microsoft Word Help | |||
Saving multiple files as html | Microsoft Word Help | |||
Document map + html export ??? | Microsoft Word Help | |||
Works Calendar Export to Word HTML | Page Layout | |||
How do I export Japanese to HTML in Unicode Hex format? | Microsoft Word Help |