E
Erik Gollot
I've made a script that search all words of a specified style.
This macro works fine but enter in an infinite loop when it find a text
with the specified style into a table
Any idea ?
Here is the script :
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set appWord = Wscript.CreateObject("Word.Application")
appWord.Documents.Open("C:\users\erik\bnpp\search.doc")
appWord.Visible = False
appWord.Selection.Find.ClearFormatting
With appWord.Selection.Find
.Text= ""
.Style = appWord.ActiveDocument.Styles("Exigence")
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While appWord.Selection.Find.Execute = True
MsgBox appWord.Selection
Loop
End With
appWord.Quit
Set appWord = Nothing
This macro works fine but enter in an infinite loop when it find a text
with the specified style into a table
Any idea ?
Here is the script :
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set appWord = Wscript.CreateObject("Word.Application")
appWord.Documents.Open("C:\users\erik\bnpp\search.doc")
appWord.Visible = False
appWord.Selection.Find.ClearFormatting
With appWord.Selection.Find
.Text= ""
.Style = appWord.ActiveDocument.Styles("Exigence")
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While appWord.Selection.Find.Execute = True
MsgBox appWord.Selection
Loop
End With
appWord.Quit
Set appWord = Nothing