locked
GetGrammaticalSuggestions? RRS feed

  • Question

  • I have a question about checking grammar with Interop.Word (Microsoft Word 11.0 Object Library).

     

    The following properties and function exists...

    Word.Range.SpellingErrors

    Word.Range.GrammaticalErrors

    Word.Application.GetSpellingSuggestions

     

    But I don't see a corresponding GetGrammaticalSuggestions function.  How else, if not with a GetGrammaticalSuggestions function, would you get the grammatical suggestions given a grammatical error?  I can see that a grammatical error is most often more complex than a simple spelling error, but surely there's got to be a way to programatically get the grammatical suggestions.  Word obviously has the feature, so why can't I get to it programatically?

     

    What I'm basically trying to do is create my own form in VB.NET that looks mostly like Word's standard spelling/grammar checking dialog box, but calls the Interop.Word functions directly.  I tried before using the Word.Document.CheckGrammar sub, which opens up and uses the standard spelling/grammar checking dialog box, but I can't seem to get consistant results with ensuring that the dialog appears on top of my application's form.  If possible, I'd like to stick with calling the Interop.Word functions from my own form, but somehow implement the feature to show the grammatical suggestions as well.

     

    Thank you.

     

    Wednesday, June 18, 2008 3:31 AM

Answers

  • Hi Larry

     

    In fact, this is not available through the Word Interop. I know of no way for you to gain access to this information. It simply has not been exposed, perhaps in part because, until recently, the spelling and grammar tools were licensed third-party products.

     

    Word has quite a few tools and things that aren't exposed to the developer. It's important to keep in mind that the Office applications were designed primarily for end-users. The exposed interfaces in the Interop are meant to customize the application. These applications are not intended for developers to coerce into their own applications.

    Wednesday, June 18, 2008 3:48 PM

All replies

  • Hi Larry

     

    In fact, this is not available through the Word Interop. I know of no way for you to gain access to this information. It simply has not been exposed, perhaps in part because, until recently, the spelling and grammar tools were licensed third-party products.

     

    Word has quite a few tools and things that aren't exposed to the developer. It's important to keep in mind that the Office applications were designed primarily for end-users. The exposed interfaces in the Interop are meant to customize the application. These applications are not intended for developers to coerce into their own applications.

    Wednesday, June 18, 2008 3:48 PM
  •  Cindy Meister wrote:

    In fact, this is not available through the Word Interop. I know of no way for you to gain access to this information. It simply has not been exposed

    Cindy, thank you very much for your reply.  I have to admit that I'm disappointed that this function isn't exposed, but at least I have a definitive answer now.

    Wednesday, June 18, 2008 4:50 PM