Home |
Search |
Today's Posts |
#3
|
|||
|
|||
If you put all of the documents in one folder and modify the string in the
PathToUse statement in the following macro to point to that folder and then you run this macro, it will count the words in all of the documents. For 1200 documents, I would put the kettle on to boil before you start. Dim i As Long Dim myFile As String Dim PathToUse As String Dim myDoc As Document PathToUse = "C:\Documents\" 'Error handler to handle error generated whenever 'the FindReplace dialog is closed On Error Resume Next 'Initiate the counter i i = 0 'Close all open documents before beginning Documents.Close SaveChanges:=wdPromptToSaveChanges 'Set the directory and type of file to batch process myFile = Dir$(PathToUse & "*.doc") While myFile "" 'Open document Set myDoc = Documents.Open(PathToUse & myFile) 'Increment the counter i with the number of words in the document i = i + myDoc.Words.Count myDoc.Close SaveChanges:=wdDoNoSaveChanges 'Next file in folder myFile = Dir$() Wend MsgBox "Total number of words is " & i & "." -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "Donald C. McNeilly" wrote in message ... Am preparing an encyclopedia that will have about 1200 + entries. Each entry is a separate document. I need a total word count for all docs. I can use an 'open' window showing the statistics and enter word count into a spreadsheet but it seems as if there should be an easier way. Other option might be to merge all the documents into one but have heard horror stories about dealing with large docs in word. Also, I cannot find any automatic way of doing this; just cut and paste each doc into one. That would be as laborious as doing the spreadsheet count. Publisher is willing to take the docs as individual entries so we have no need to merge them all. Appreciate any help. Have had great luck with the publisher group. dcmc |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
In typing dates in Word, i.e. "January 12" how do you keep the "1. | Microsoft Word Help | |||
word xp crashes after macros are recorded | Microsoft Word Help | |||
WordPerfect - copying formatting | Page Layout | |||
WP Delay Code - Word Equiv | Microsoft Word Help | |||
Continuous breaks convert to next page breaks | Microsoft Word Help |