How to get a list of suggested corrections for Word grammar errors

Cavalier King Charles Spaniel 1 Reputation point
2022-09-22T13:26:22.743+00:00

I have developed an application in C# that utilizes Word's "Spelling and Grammar".

In MSI version of Word, you can check for spelling and grammatical errors and get a list of possible corrections. However, the C2R version can check grammatical errors, but cannot obtain a correction candidate list.
How do I get a suggested list of grammatical errors?

■ Methods implemented by the application
・Spelling error
   Application.GetSpellingSuggestions
   →You can get the correction candidate list

· Grammar error
   CommandBars["Grammar"].Controls
   →Because of the recognition that there is no dedicated method, the one with the ID "0" is extracted from the control and acquired.
    There is no problem with the MSI version, but it cannot be acquired with the C2R version.
 

■ CommandBars["Grammar"].Controls Source code details

--------------------------------------

Microsoft.Office.Core.CommandBarControls cmdBarCtls =  
    this.myDoc.CommandBars["Grammar"].Controls;           
if (cmdBarCtls == null) {                                 
    return false;                                         
}  
 
List<string> reviseList = res.ReviseList;                 
foreach (Microsoft.Office.Core.CommandBarControl ctrl in cmdBarCtls) {  
                                       
    if (ctrl.Id == 0) {                
    reviseList.Add(ctrl.Caption);      
    }  

--------------------------------------

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,522 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. macropod 91 Reputation points
    2022-09-22T23:29:53.42+00:00

    Word has no GetGrammarSuggestions equivalent to GetSpellingSuggestions