View Single Post
  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Pamelia Caswell via OfficeKB.com Pamelia Caswell  via OfficeKB.com is offline
external usenet poster
 
Posts: 84
Default Proofreading macro

I've used a macro similar to this for several years. I strongly recommend
that track changes be turned on --as Doug's macro does-- or the changes
otherwise highlighted.

Pam

Doug Robbins - Word MVP wrote:
If you had the words to be replaced in column 1 of a table in a Word
document, starting in row 2 and the replacement words in column 2 of the
same table, and you save and close that document and open it when asked to
do so. The following macro run when the document in which you want the
replacements to be made is the active document should do what you want:

Dim i As Long
Dim rngFind As Range
Dim rngReplace As Range
Dim Source As Document
Dim Target As Document
Set Target = ActiveDocument
Target.TrackRevisions = True
With Dialogs(wdDialogFileOpen)
.Show
End With
Set Source = ActiveDocument
With Source.Tables(1)
For i = 2 To .Rows.Count
Set rngFind = .Cell(i, 1).Range
rngFind.End = rngFind.End - 1
Set rngReplace = .Cell(i, 2).Range
rngReplace.End = rngReplace.End - 1
With Target
.TrackRevisions = True
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=rngFind.Text, Forward:=True, _
MatchWildcards:=False, Replacewith:=rngReplace.Text, _
Wrap:=wdFindContinue, MatchCase:=False) = True
Loop
End With
End With
Next i
End With
Source.Close wdDoNotSaveChanges
Target.TrackRevisions = False

I am looking for help to write a macro that will proofread a series of
large

[quoted text clipped - 15 lines]
The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ement/201005/1