View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Lako
 
Posts: n/a
Default Word 2003 Selection or Range Objects

Cooz

I am up and running.
--
Thanks for the help.
Lako


"Cooz" wrote:

Hi Lako,

Use this macro:

Sub MakeDocs()
Const strSaveDir As String = "G:\temp"
Dim intN As Integer, strN As String

For intN = 1 To ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)
strN = LTrim(Str(intN))

Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=strN
ActiveDocument.Bookmarks("\Page").Select
Selection.Copy

Documents.Add
Selection.Paste
ActiveDocument.SaveAs FileName:=strSaveDir & "\RTFDoc" & strN &
".rtf", _
FileFormat:=wdFormatRTF, AddToRecentFiles:=False
ActiveDocument.Close

Next intN

End Sub

Substitute "G:\temp" for the directory in which yout rtf documents are to be
saved. Be sure your 270 page document is the active document when you run the
macro. The macro creates filenames like "RTFDoc1.rtf", "RTFDoc2.rtf" and so
on. The files are based on Normal dot. If you set the default margins
slightly wider or the default font size somewhat smaller, you prevent
creating a blank second page.

Good luck,
Cooz
--
PS: If this is a satisfying answer to your question and you're logged in via
the Microsoft site, please click Yes to "Did this post answer the question?".
Thanks.

"Lako" wrote:

I have a large document of 270 pages. I need to save each page as a separate
rtf file. I tried recording a macro and modifying it to iterate through all
the pages selecting, copying and saving as a new document, but the selection
starting from the beginning of the page using shift & ctrl-pgdn-pgdn would
not select the page when used in the macro (it did fine when using it from
the keyboard). I do not understand how to make the selection in VBA using the
range or selection objects. Any help in how to set the selection for a page
would be much appreciated
--
Thanks much
Lako