I agree with Bob that this is not a good idea. Word document format is
incompatible with html format and saving a document to html will have little
relationship to the original document layout. Furthermore html does not
support 'pages' nor does it support page headers/footers and a variety of
other things that could make up your document. However, the following macro
will split a document, in Word 2003, by 'page' and save each 'page' as an
html format document. Don't blame us if it doesn't do what you imagine.
Sub SplitByPage()
Dim mask As String
Letters = ActiveDocument.Bookmarks("\page").Range
mask = "ddMMyy"
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
Application.ScreenUpdating = False
sName = "Split"
Docname = "D:\My Documents\Test\Merge\" _
& sName & " " & Format(Date, mask) & " " & LTrim$(Str$(Counter)) &
".htm"
On Error GoTo oops:
ActiveDocument.Bookmarks("\page").Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatHTML
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
oops:
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>