Copying a list of files in Word

  • Thread starter Thread starter lucyzoe
  • Start date Start date
L

lucyzoe

I'm working on creating a form/database in Excel of
specific files in Word. Rather than typing in the names of
the files, I'd like to copy and paste the list of files.
For some reason, the only option I have is to print. I
don't want an image...I want a list in text format. Any
suggestions? Many thanks.
 
Not exactly sure what you're trying to do, but I THINK you want to create a spreadsheet(s) in Excel with a list of Documents available for users to load and edit...
....but, problem is there's too many docs to type them...

If I were going to try something like this... (without looking for some already existing software package)...
I would go to the command prompt, do a global search for all word documents (for example) and redirect the ooutput into a text file which I could then use later to copy/past those files I want included in my Spreadsheet.

for example, the following example
dir *.doc /s > DOCS.TXT
would find all word documents (or any other files with extension "doc" ) in the current and all sub-folders,
and make a nice neat list for you in the text file named DOCS.TXT which it creates for you.

for more help with using "dir" in the command prompt, type:
dir /?

Hope this helps...
Chris
----- (e-mail address removed) wrote: -----

I'm working on creating a form/database in Excel of
specific files in Word. Rather than typing in the names of
the files, I'd like to copy and paste the list of files.
For some reason, the only option I have is to print. I
don't want an image...I want a list in text format. Any
suggestions? Many thanks.
 
I'm working on creating a form/database in Excel of
specific files in Word. Rather than typing in the names of
the files, I'd like to copy and paste the list of files.
For some reason, the only option I have is to print. I
don't want an image...I want a list in text format. Any
suggestions? Many thanks.

The easiest way is to open a command prompt, go to the folder
you want and pipe the output to a text file, e.g.

dir *.doc > c:\filelist.txt

The above will give you a listing of all files with a .doc extension
and put it in a file called filelist.txt, in the root folder of C:.

Rick
 
I'm working on creating a form/database in Excel of
specific files in Word. Rather than typing in the names of
the files, I'd like to copy and paste the list of files.
For some reason, the only option I have is to print. I
don't want an image...I want a list in text format. Any
suggestions? Many thanks.


1) Try a group dedicated to M$ Excel. (microsoft.public.excel)

2) Ask about macros to perform the task
--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.

To e-mail me, replace the DOTs in the Reply-To: address with dots!
 
You could try command mode (DOS)
after 'cd' to the relevant directory
Do:
dir > filelist.txt

jt:
 
I'm working on creating a form/database in Excel of
specific files in Word. Rather than typing in the names of
the files, I'd like to copy and paste the list of files.
For some reason, the only option I have is to print. I
don't want an image...I want a list in text format. Any
suggestions? Many thanks.

OK, this is the wrong group for this. Sorry everyone.

Lucy, try this:-

Sub ListWordFiles()
Dim PathName As String
Dim PathNameFile As String
Dim FolderFiles() As String
Dim TheFile As String
Dim FCount As Integer
Dim RangeX As String

PathName = <"My Path Name">
PathNameFile = PathName + "*.*"
FCount = 0
TheFile = Dir(PathNameFile)
While TheFile <> Empty
FCount = FCount + 1
ReDim Preserve FolderFiles(1 To FCount)
' declares the array variable again (size+1)
TheFile = PathName + "\" + TheFile
FolderFiles(FCount) = TheFile
TheFile = Dir
Wend

Worksheets("Sheet1").Activate
ActiveSheet.Cells.ClearContents
Cells(1, 1).Activate
For i = 1 To FCount
If Right(FolderFiles(i), 4) = ".doc" Then
ActiveCell.Value = FolderFiles(i)
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
End If
Next i

RangeX = "A1:A" + Format(FCount)
Range(RangeX).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Erase FolderFiles ' deletes the varible contents, free some memory
Cells(1, 1).Select

End Sub

You'll have to replace <"My Path Name"> with wherever your .doc files are.
--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.

To e-mail me, replace the DOTs in the Reply-To: address with dots!
 
Back
Top