Re: How to save individual HTML pages?
- From: "Graham Mayor" <gmayor@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Feb 2007 09:15:12 +0200
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
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
raylaur wrote:
Dude - if you're going to reply why not offer something helpful?
There are valid reasons why it would be of value. I work in corporate
training and most course developers are fluent with Word. It is more
economical to develop documents in one program and save them as both
PDF and HTML. Create once, publish multiple formats. They are not
designers and don't get into things like FrontPage or Dremweaver.
PowerPoint is too clumsy a tool for anything but bullet slides.
"CyberTaz" wrote:
"raylaur" <raylaur@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6473FFDC-7D88-4D4C-BFDC-0060E848796C@xxxxxxxxxxxxxxxx
Is there a way to save individual HTML pages from Word2003? This
really should be an option!
Well, there are those who would argue "No, it shouldn't" because
Word is *not* a web design program. Depending on which version of
Office you have you will find that PowerPoint & Publisher *both*
provide such capability, as does Front Page.
If there is a macro, I'd appreciate a link or if the code can be
posted here. After scouring the web I tried a macro called sub
splitter that was written in VB for Word 97 but doesn't work in
Word2003.
Thanks in advance for any help.
And you're probably fortunate that it doesn't... It's typically a
far better result if you use the right tool rather than trying to
hack another into doing a job for which it isn't intended :-)
--
HTH |:>)
Bob Jones
[MVP] Office:Mac
.
- References:
- Re: How to save individual HTML pages?
- From: CyberTaz
- Re: How to save individual HTML pages?
- Prev by Date: Re: make it possible to change (lighten) WORD highlighter colors
- Next by Date: Re: How can I delete Wordpad, and convert documents to Word 2003?
- Previous by thread: Re: How to save individual HTML pages?
- Next by thread: Re: Tracked changes when copied & Pasted are accepted
- Index(es):
Relevant Pages
|