Reply
 
Thread Tools Display Modes
  #1   Report Post  
Lawrence
 
Posts: n/a
Default Importing multiple rtf files

Hello

I have over 100 rtf files, each about 25 pages in length. Is there a way to
import all 100 files into a single Word document, without having to import
each individually? I thought about developing a macro, but don't know how to
specify the files or fodler name.

Thanks.
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

Try this:

Dim MyPath As String
Dim MyFile As String
Dim Source As Document, Target As Document

With Dialogs(wdDialogCopyFile)
If .Display() -1 Then Exit Sub
MyPath = .Directory
End With
If Len(MyPath) = 0 Then Exit Sub
If Asc(MyPath) = 34 Then
MyPath = Mid$(MyPath, 2, Len(MyPath) - 2)
End If
MyFile = Dir$(MyPath & "*.rtf")
Set Target = Documents.Add
While MyName ""
Set Source = Documents.Open(MyPath & myFile)
Target.Range.InsertAfter Source.Range
Source.Close wdDoNotSaveChanges
MyName = Dir
Wend


--
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
"Lawrence" wrote in message
...
Hello

I have over 100 rtf files, each about 25 pages in length. Is there a way
to
import all 100 files into a single Word document, without having to import
each individually? I thought about developing a macro, but don't know how
to
specify the files or fodler name.

Thanks.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I open multiple Word 2003 files to display on dual monitors mally Microsoft Word Help 6 July 4th 05 11:00 AM
Working on multiple word files from a single file???? Rich New Users 5 May 30th 05 03:10 PM
How can you merge data from multiple source files? Charles Miller Mailmerge 1 April 12th 05 02:05 PM
Table of Contents - Multiple Files megamble2 Microsoft Word Help 4 January 21st 05 08:01 PM
How can I insert multiple files at once into a document? Confused Word User Microsoft Word Help 1 December 10th 04 05:12 PM


All times are GMT +1. The time now is 03:56 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"