I have the following code:
Sub WordtoTxtwLB()
\'
\' WordtoTxtwLB Macro
\'
\'
Dim fileName As String
myFileName = ActiveDocument.Name
ActiveDocument.SaveAs2
To edit all the word documents in a directory I built this simple subroutine.
The subRoutine loops through the directory and opens each *.doc file it finds. Then on the open document file it calls the second subRoutine. After the second subRoutine is finished the document is saved and then closed.
Sub DoVBRoutineNow()
Dim file
Dim path As String
path = "C:\Documents and Settings\userName\My Documents\myWorkFolder\"
file = Dir(path & "*.doc")
Do While file <> ""
Documents.Open FileName:=path & file
Call secondSubRoutine
ActiveDocument.Save
ActiveDocument.Close
file = Dir()
Loop
End Sub
~~~~~~