none
Grammer - Passive Voice RRS feed

  • Question

  • I see that Word has the capability to underline passive voice in a sentence.  How can I write VBA to perform this?  I want to write the VBA to a button in the ribbon that will perform only this action and highlight the passive voice (instead of underlining it).
    Wednesday, March 12, 2014 9:38 PM

Answers

  • Hi,

    Based on my understanding, you want to write VBA code to highlight the passive voice.I don't think there are such kind of API to get the range a passive voice sentence.
    CheckGrammar  just checks grammatical errors, you can’t get which range contain a passive voice sentence.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Marvin_Guo Thursday, March 20, 2014 6:08 AM
    Friday, March 14, 2014 9:56 AM

All replies

  • Hello,

    The Word object model provide two methods for checking grammatical and spelling errors:

    1.  CheckGrammar - Checks a string for grammatical errors. Returns a Boolean to indicate whether the string contains grammatical errors. True if the string contains no errors.

    2. CheckSpelling - Checks a string for spelling errors. Returns a Boolean to indicate whether the string contains spelling errors. True if the string has no spelling errors.

    Thursday, March 13, 2014 9:27 PM
  • Hi,

    Based on my understanding, you want to write VBA code to highlight the passive voice.I don't think there are such kind of API to get the range a passive voice sentence.
    CheckGrammar  just checks grammatical errors, you can’t get which range contain a passive voice sentence.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Marvin_Guo Thursday, March 20, 2014 6:08 AM
    Friday, March 14, 2014 9:56 AM