TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
In our previous episode, JIMCHEVAL -at- AOL -dot- COM said:
>
> Here's some more sample code for Word 97 macros. It's also an invitation to
> help, since the Word 97 version isn't as tight as I'd like it (see comments
> below.)
Great minds think alike, or something like that. I just finished a
Word 95 (Word 7.0) macro that accesses every file in a specified
directory (including subdirectories) and inserts file name (with
path), author, creation date, and last changed date in a separate
document. I would have liked to have included title as well, but a
number of those include tabs, and the CleanString command doesn't get
rid of tabs, so it was easier to leave them out.
Here's the code:
Sub MAIN
On Error Resume Next
FileOpen "f:\actlist.doc" 'This is the ongoing "active list" document
'It must already be created for the macro to run properly
For count = 1 To numfilesfound
FileNme$ = FoundFileName$(count)
FileOpen(FileNme$)
Dim dlg2 As FileSummaryInfo
GetCurValues dlg2
Author$ = dlg2.Author
Create$ = Left$(dlg2.CreateDate, 8)
LastSave$ = Left$(dlg2.LastSavedDate, 8)
FileClose 2
If count <> 1 Then InsertPara
Insert LCase$(FileNme$)
Insert Chr$(9)
Insert Author$
Insert Chr$(9)
Insert Create$
Insert Chr$(9)
Insert LastSave$
Next
End Sub
Back when I first developed a variant of this macro for Word 2.0, it
was much more complicated, because Word didn't allocate enough memory
for macros, and it choked after about 75 documents. I had to write
something that would stop every 50 documents, let me save and close
Word, then open Word and resume from where it left off. This macro
made it through 3,500 documents in Word 7.0 without a glitch.
*********************************************************************
Beth Friedman bjf -at- wavefront -dot- com
"What happened to the kippers left from breakfast?
Or maybe there's a bit of cold roast pheasant.
I am the king now, and I want a sandwich." -- John M. Ford
TECHWR-L (Technical Communication) List Information: To send a message
to 2500+ readers, e-mail to TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU -dot- Send commands
to LISTSERV -at- LISTSERV -dot- OKSTATE -dot- EDU (e.g. HELP or SIGNOFF TECHWR-L).
Search the archives at http://www.documentation.com/ or search and
browse the archives at http://listserv.okstate.edu/archives/techwr-l.html