Aspose::Words::Document::get_GrammarChecked method

Document::get_GrammarChecked method

Returns true if the document has been checked for grammar.

bool Aspose::Words::Document::get_GrammarChecked()

Examples

Shows how to set spelling or grammar verifying.

auto doc = MakeObject<Document>();

// The string with spelling errors.
doc->get_FirstSection()->get_Body()->get_FirstParagraph()->get_Runs()->Add(MakeObject<Run>(doc, u"The speeling in this documentz is all broked."));

// Spelling/Grammar check start if we set properties to false.
// We can see all errors in Microsoft Word via Review -> Spelling & Grammar.
// Note that Microsoft Word does not start grammar/spell check automatically for DOC and RTF document format.
doc->set_SpellingChecked(checkSpellingGrammar);
doc->set_GrammarChecked(checkSpellingGrammar);

doc->Save(ArtifactsDir + u"Document.SpellingOrGrammar.docx");

See Also