Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2017, 09:11 PM
macropod's Avatar
macropod macropod is offline Automatic full document spell check and correction without user intervention Windows 7 64bit Automatic full document spell check and correction without user intervention Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by tonyony View Post
Hi, the VBA code you have generated fixes the spelling mistakes but doesn't solve the issue with the Grammatical errors that come up when for example i have left a space between a word and a comma.
I'd have thought my previous reply made that clear enough - VBA has no GetGrammarSuggestions equivalent to GetSpellingSuggestions.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 09-22-2017, 09:21 PM
tonyony tonyony is offline Automatic full document spell check and correction without user intervention Windows 10 Automatic full document spell check and correction without user intervention Office 2016
Novice
 
Join Date: Sep 2017
Posts: 4
tonyony is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
VBA has no GetGrammarSuggestions equivalent to GetSpellingSuggestions.
That's what I thought.. Hence, no way to accept automatically Word's suggestions on grammar? Do I have to run the Spell&Grammar check and go through one by one?
Reply With Quote
  #3  
Old 09-22-2017, 09:23 PM
macropod's Avatar
macropod macropod is offline Automatic full document spell check and correction without user intervention Windows 7 64bit Automatic full document spell check and correction without user intervention Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by tonyony View Post
Do I have to run the Spell&Grammar check and go through one by one?
Apparently. Although a macro could be used, the best it might do is highlight the issues; you'd then have to decide what to do about them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 09-22-2017, 09:31 PM
tonyony tonyony is offline Automatic full document spell check and correction without user intervention Windows 10 Automatic full document spell check and correction without user intervention Office 2016
Novice
 
Join Date: Sep 2017
Posts: 4
tonyony is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Apparently. Although a macro could be used, the best it might do is highlight the issues; you'd then have to decide what to do about them.
Thanks very much for your help

I would have 2 last questions if you could be so kind as to reply

1. What would be the difference between the macro you have posted above and this macro below?

Sub AcceptSpellingSuggestions()
Dim er As Range
For Each er In ActiveDocument.SpellingErrors
If er.GetSpellingSuggestions.Count > 0 Then
er.Text = er.GetSpellingSuggestions.Item(1).Name
End If
Next
End Sub

2. would there be a way to integrate any of these two macros so that they would ignore words that begin with a capital letter that are being picked up as spelling mistakes , so that those remain unchanged ?
Reply With Quote
  #5  
Old 09-22-2017, 09:47 PM
macropod's Avatar
macropod macropod is offline Automatic full document spell check and correction without user intervention Windows 7 64bit Automatic full document spell check and correction without user intervention Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by tonyony View Post
1. What would be the difference between the macro you have posted above and this macro below?
Two fundamental difference are that my code:
1. highlights (in Pink) any spelling errors for which there are no suggested corrections; and
2. provides for certain words to be added to an exclusions list so they're highlighted (Green) instead of being replaced.
That's obvious from even a cursory read of the code.
Quote:
Originally Posted by tonyony View Post
2. would there be a way to integrate any of these two macros so that they would ignore words that begin with a capital letter that are being picked up as spelling mistakes , so that those remain unchanged ?
There's nothing to integrate; your macro already does only part of what mine does. As for excluding words with a first capital, you might try something based on:
Code:
Sub AutoSpellCorrect()
Dim Rng As Range, oSuggestions As Variant, StrExcl As String
StrExcl = ",word1,word2,word3,"
For Each Rng In ActiveDocument.Range.SpellingErrors
  With Rng
    If LCase(.Characters.First) = .Characters.First Then
      If InStr(StrExcl, "," & .Text & ",") = 0 Then
        If .GetSpellingSuggestions.Count > 0 Then
          Set oSuggestions = .GetSpellingSuggestions
          .Text = oSuggestions(1)
        Else
          .HighlightColorIndex = wdPink
        End If
      Else
        .HighlightColorIndex = wdBrightGreen
      End If
    Else
      .HighlightColorIndex = wdYellow
    End If
  End With
Next
End Sub
Whether you use any of the highlights is, of course, optional; simply comment-out/delete the ones you don't want.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Protected Document (Form) that allows Spell Check beve56 Word 3 03-21-2014 06:15 PM
Spell check checking only part of document Adeyo Word 1 02-24-2013 10:49 PM
Spell Check without User intervention looney001 Outlook 0 01-10-2013 12:41 AM
Spell Check Not Working For Particular User newman Outlook 0 11-18-2012 08:45 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:04 AM.


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