Hi everybody,
I wonder...:
Sub test45620()
Dim strResult As String
Dim lngResult As String
Dim l As Long
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogEditReplace)
On Error Resume Next
oDlg.Display
strResult = Err.Description
For l = 1 To Len(strResult)
If IsNumeric(Mid(strResult, l, 1)) Then
lngResult = lngResult & Mid(strResult, l, 1)
End If
Next
MsgBox "number of replacements = " & lngResult
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP, WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
George Lee - 02 Aug 2005 15:56 GMT
Funny, that message with the number of replacements is really an error.
However, the dialog only appears if the dialog is actually displayed? If you
access it programmatically (through VBA code), you can't get it?
> Hi everybody,
>
[quoted text clipped - 23 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Thanks for the idea. I also saw Helmut's suggestion and although they are
both useful, they're not very elegant solutions. That's no one's fault but it
is curious what Microsoft decides to exposure and what they hide.
> http://word.mvps.org/faqs/macrosvba/GetNoOfReplacements.htm
>
> > How can you get the total number of replacements after using Find/Replace
> > with wdReplaceAll?