Greetings,
I recently wrote a macro that will swap out one word style through out a document with another word style of the user's choice. This works fine. The problem is that it is much too slow. We have thousands of files to nuke old styles from in several directories.
Would anyone know how to take a directory specified by the user and do the style manipulation in all the word docs in that directory? I've included my macro as is below:
Sub TempBackup()
'
' ChangeDocumentStyles Macro
' Macro created {4.2.2003} by {Taylor Holmes}
'
' Purpose: To provide a way to quickly find and replace specified
' styles and replace them with another specified style by the user.
Dim OriginalStyle As String
Dim ReplaceStyle As String
Dim msgPrompt1 As String
Dim msgPrompt2 As String
Dim msgTitle As String
Dim Continue As String
StartReplace:
msgPrompt1 = "Please enter the style name you'd like to replace."
msgPrompt2 = "Please enter the style name you'd like to replace it with."
msgPrompt3 = "Would you like to replace another style?"
msgTitle = "SRM: Style Replace Macro"
' Prompt the user for the style to find
OriginalStyle = InputBox(msgPrompt1, msgTitle)
If OriginalStyle = "" Then GoTo EndRoutine
ReplaceStyle = InputBox(msgPrompt2, msgTitle)
If ReplaceStyle = "" Then GoTo EndRoutine
' Use the active Word document.
With ActiveDocument.Content.Find
.Style = ActiveDocument.Styles(OriginalStyle)
.Replacement.Style = ActiveDocument.Styles(ReplaceStyle)
.Execute Replace:=wdReplaceAll
End With
Continue = MsgBox(msgPrompt3, vbYesNo, msgTitle)
If Continue = vbYes Then GoTo ChangeDocumentStyles
EndRoutine:
End Sub
Thanks for any help you might be able to offer in pointing me towards the right direction!
Dijinn