View Single Post
 
Old 03-01-2020, 03:26 AM
Leslie Leslie is offline Windows 8 Office 2010
Novice
 
Join Date: Oct 2019
Posts: 13
Leslie is on a distinguished road
Default

Quote:
Originally Posted by eduzs View Post
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 View Post
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.
Reply With Quote