Progress Indicator

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
 
D

Doug Robbins - Word MVP

Hi Kevin,

Take a look at the code for the progress bar in the Word merge utility on
fellow MVP Albert Kallal's site at :
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

You might be able to do something with that.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Kevin R said:
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 Boolean
Dim changeFlag As Boolean

selFlag = True

Selection.HomeKey Unit:=wdStory
Do While selFlag
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = wrong
.Replacement.Text = right
.Forward = True
.Wrap = wdFindContinue
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With

selFlag = Selection.Find.Execute
If selFlag Then
changeFlag = Not check
If check Then changeFlag = (MsgBox("replace " & Chr(34) & wrong & Chr(34)
& " with " & Chr(34) & right & Chr(34) & "? ", vbYesNo) = vbYes)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top