A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Proofreading macro



 
 
Thread Tools Display Modes
  #1  
Old May 7th 10, 12:03 PM posted to microsoft.public.word.docmanagement
Grey Old Man
external usenet poster
 
Posts: 8
Default Proofreading macro

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

A text file will be used for all suggested replacements. For example:

phone=telephone
fax=facsimile
&=and
24 x 7=24x7
7 x 24=24x7
mgmt=management

The macro will read the text file and find and replace as appropriate.
Track changes must be switched on at the start and switched off at the end
of the routine.

The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.

Ads
  #2  
Old May 7th 10, 12:43 PM posted to microsoft.public.word.docmanagement
Graham Mayor
external usenet poster
 
Posts: 19,312
Default Proofreading macro

You cannot 'proof read' a document with a macro. You can however use a macro
to perform a series of pre-defined replacements, such as those you have
suggested.

Save the list as a two column table. If you already have the list in the
format shown, open the list in Word and convert the text to a two column
table split at the = sign. then run the following macro. You need to bear in
mind that the searches will follow the order in the table and will complete
without prompting.


Sub ReplaceFromTableList()
Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oFind As Range, oReplace As Range
Dim i As Long
Dim sFname As String
'Change the path to reflect where you have saved the table document.
sFname = "D:\My Documents\Word Documents\changes.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oFind = cTable.Cell(i, 1).Range
oFind.End = oFind.End - 1
Set oReplace = cTable.Cell(i, 2).Range
oReplace.End = oReplace.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oFind, _
ReplaceWith:=oReplace, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub
http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Grey Old Man" wrote in message
...
I am looking for help to write a macro that will proofread a series of
large
documents for me.

A text file will be used for all suggested replacements. For example:

phone=telephone
fax=facsimile
&=and
24 x 7=24x7
7 x 24=24x7
mgmt=management

The macro will read the text file and find and replace as appropriate.
Track changes must be switched on at the start and switched off at the end
of the routine.

The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.



  #3  
Old May 7th 10, 12:43 PM posted to microsoft.public.word.docmanagement
Graham Mayor
external usenet poster
 
Posts: 19,312
Default Proofreading macro

You cannot 'proof read' a document with a macro. You can however use a macro
to perform a series of pre-defined replacements, such as those you have
suggested.

Save the list as a two column table. If you already have the list in the
format shown, open the list in Word and convert the text to a two column
table split at the = sign. then run the following macro. You need to bear in
mind that the searches will follow the order in the table and will complete
without prompting.


Sub ReplaceFromTableList()
Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oFind As Range, oReplace As Range
Dim i As Long
Dim sFname As String
'Change the path to reflect where you have saved the table document.
sFname = "D:\My Documents\Word Documents\changes.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oFind = cTable.Cell(i, 1).Range
oFind.End = oFind.End - 1
Set oReplace = cTable.Cell(i, 2).Range
oReplace.End = oReplace.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oFind, _
ReplaceWith:=oReplace, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub
http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Grey Old Man" wrote in message
...
I am looking for help to write a macro that will proofread a series of
large
documents for me.

A text file will be used for all suggested replacements. For example:

phone=telephone
fax=facsimile
&=and
24 x 7=24x7
7 x 24=24x7
mgmt=management

The macro will read the text file and find and replace as appropriate.
Track changes must be switched on at the start and switched off at the end
of the routine.

The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.



  #4  
Old May 7th 10, 12:57 PM posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,832
Default Proofreading macro

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




--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Grey Old Man" wrote in message
...
I am looking for help to write a macro that will proofread a series of
large
documents for me.

A text file will be used for all suggested replacements. For example:

phone=telephone
fax=facsimile
&=and
24 x 7=24x7
7 x 24=24x7
mgmt=management

The macro will read the text file and find and replace as appropriate.
Track changes must be switched on at the start and switched off at the end
of the routine.

The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.

  #5  
Old May 7th 10, 12:57 PM posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,832
Default Proofreading macro

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




--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Grey Old Man" wrote in message
...
I am looking for help to write a macro that will proofread a series of
large
documents for me.

A text file will be used for all suggested replacements. For example:

phone=telephone
fax=facsimile
&=and
24 x 7=24x7
7 x 24=24x7
mgmt=management

The macro will read the text file and find and replace as appropriate.
Track changes must be switched on at the start and switched off at the end
of the routine.

The reason for using a text file is for simplicity and easy maintenance
without knowledge of VBA code. Thanks in anticipation.

  #6  
Old May 7th 10, 01:22 PM posted to microsoft.public.word.docmanagement
Pamelia Caswell via OfficeKB.com
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

  #7  
Old May 7th 10, 01:22 PM posted to microsoft.public.word.docmanagement
Pamelia Caswell via OfficeKB.com
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Proofreading doesn't work (for Korean) kevin Microsoft Word Help 1 April 16th 09 06:54 PM
Common Proofreading Symbols Proofreading Symbols for Word Microsoft Word Help 0 November 14th 08 06:57 PM
Is there a specific edit/proofreading button Samct New Users 4 October 27th 06 11:59 PM
proofreading swallowbird New Users 5 March 12th 06 07:24 PM
Scroll too fast for proofreading michimac Microsoft Word Help 2 April 9th 05 03:05 AM


All times are GMT +1. The time now is 02:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright 2004-2022 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.