Quote:
Originally Posted by eduzs
Maybe something like:
Code:
Sub test()
Dim nPages As Long, StrTemp As String
nPages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
Application.ScreenUpdating = False
For x = 1 To nPages
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=x
StrTemp = StrTemp & x & " page - " & ActiveDocument.Bookmarks("\Page").Range.SpellingErrors.Count & vbCr
Next x
Application.ScreenUpdating = True
MsgBox StrTemp
End Sub
|
Quote:
Originally Posted by macropod
Try:
Code:
Sub Demo()
Dim Rng As Range, i As Long, p As Long, StrOut As String
p = 1
For Each Rng In ActiveDocument.Range.SpellingErrors
With Rng
If .Information(wdActiveEndPageNumber) > p Then
If i > 0 Then
StrOut = StrOut & vbCr & "Pg: " & p & "-" & i
p = .Information(wdActiveEndPageNumber): i = 1
End If
Else
i = i + 1
End If
End With
Next
StrOut = StrOut & vbCr & "Pg: " & p & "-" & i
MsgBox StrOut
End Sub
|
Great both of you, masters! Thanks again for your quick response.