Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-29-2020, 03:35 PM
Leslie Leslie is offline Count and display number of spell check errors Windows 8 Count and display number of spell check errors Office 2010
Novice
Count and display number of spell check errors
 
Join Date: Oct 2019
Posts: 13
Leslie is on a distinguished road
Default Count and display number of spell check errors


I wish to get spell check error count details (page wise) displayed through a MSGBOX (macro).

For instance:
1st page has 20 red colored words (spell checked word document).
2nd has 58.
3rd has 10.

MSGBOX needs to display:
1st page - 20
2nd - 58
3rd - 10

Help appreciated.
Reply With Quote
  #2  
Old 02-29-2020, 07:15 PM
eduzs eduzs is offline Count and display number of spell check errors Windows 10 Count and display number of spell check errors Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

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
__________________
Backup your original file before doing any modification.
Reply With Quote
  #3  
Old 02-29-2020, 11:07 PM
macropod's Avatar
macropod macropod is offline Count and display number of spell check errors Windows 7 64bit Count and display number of spell check errors Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 03-01-2020, 03:26 AM
Leslie Leslie is offline Count and display number of spell check errors Windows 8 Count and display number of spell check errors Office 2010
Novice
Count and display number of spell check errors
 
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's with the New Spell Check? CrossReach Word 1 01-16-2019 06:34 AM
Is there a way to display a count of number of emails I sent today? Yirg Outlook 0 01-20-2015 05:28 AM
Spell Check HondaS600 Office 5 08-26-2013 01:04 PM
Count and display number of spell check errors Display unique values and count the number of child items vthomeschoolmom Excel 2 07-25-2013 06:17 AM
Count and display number of spell check errors Spell Check CommoMP Word 5 05-30-2011 05:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft