K
Kevin R
I need to show a progress indicator either on the screen or in the status bar of the word document. I have a template stored in the startup path that contains a macro that the user can run to check for errors caused by dictation using Dragon. Its thousands of lines of code (over 8000) that I have had to break into 8 macros/routines. Basically there is a function that runs against these macros in a loop checking for the incorrect word or phrase and prompting the user to replace it with the correct word or skip to the next. Since it is so long, I want to show some type of indicator on the screen to show how far along the process is. I tried using the suggestion on the Word MVP site but that doesn't really work for me because of this loop it keeps coming up. Help please. The Function is as follows..
Function CheckDragonWords(wrong As String, right As String, check As Boolean
Dim selFlag As Boolea
Dim changeFlag As Boolea
selFlag = Tru
Selection.HomeKey Unit:=wdStor
Do While selFla
Selection.Find.ClearFormattin
Selection.Find.Replacement.ClearFormattin
With Selection.Fin
..Text = wron
..Replacement.Text = righ
..Forward = Tru
..Wrap = wdFindContinu
..Wrap = wdFindSto
..Format = Fals
..MatchCase = Tru
..MatchWholeWord = Tru
..MatchWildcards = Fals
..MatchSoundsLike = Fals
..MatchAllWordForms = Fals
End Wit
selFlag = Selection.Find.Execut
If selFlag The
changeFlag = Not chec
If check Then changeFlag = (MsgBox("replace " & Chr(34) & wrong & Chr(34) & " with " & Chr(34) & right & Chr(34) & "? ", vbYesNo) = vbYes
If changeFlag The
Selection.MoveLeft Unit:=wdCharacte
Selection.Find.Execute Replace:=wdReplaceOn
Selection.MoveRight Unit:=wdCharacte
End I
End If ' selFla
Loo
End Functio
An example of the other code is as follows..
Sub DragonCheck1(
CheckDragonWords wrong:=" for unsupported", right:=" for an unsupported", check:=Tru
CheckDragonWords wrong:=" she as ", right:=" she has ", check:=Tru
End Sub
Function CheckDragonWords(wrong As String, right As String, check As Boolean
Dim selFlag As Boolea
Dim changeFlag As Boolea
selFlag = Tru
Selection.HomeKey Unit:=wdStor
Do While selFla
Selection.Find.ClearFormattin
Selection.Find.Replacement.ClearFormattin
With Selection.Fin
..Text = wron
..Replacement.Text = righ
..Forward = Tru
..Wrap = wdFindContinu
..Wrap = wdFindSto
..Format = Fals
..MatchCase = Tru
..MatchWholeWord = Tru
..MatchWildcards = Fals
..MatchSoundsLike = Fals
..MatchAllWordForms = Fals
End Wit
selFlag = Selection.Find.Execut
If selFlag The
changeFlag = Not chec
If check Then changeFlag = (MsgBox("replace " & Chr(34) & wrong & Chr(34) & " with " & Chr(34) & right & Chr(34) & "? ", vbYesNo) = vbYes
If changeFlag The
Selection.MoveLeft Unit:=wdCharacte
Selection.Find.Execute Replace:=wdReplaceOn
Selection.MoveRight Unit:=wdCharacte
End I
End If ' selFla
Loo
End Functio
An example of the other code is as follows..
Sub DragonCheck1(
CheckDragonWords wrong:=" for unsupported", right:=" for an unsupported", check:=Tru
CheckDragonWords wrong:=" she as ", right:=" she has ", check:=Tru
End Sub