Solved

Check Grammer using C#

Posted on 2014-10-19
2
137 Views
Last Modified: 2014-11-18
How to check grammer in a paragraph using C# Office.Interop.word.
Please give example.
0
Comment
Question by:mannevenu26
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40391481
Hi,

pls try

using System;
using Word =  Microsoft.Office.Interop.Word;

class Program
{
    static void Main()
    {



        //int myErrors = 0;
        // Open a doc file.
        object oMissing = System.Reflection.Missing.Value;


        Word.Application application = new Word.Application();


        application.Visible = true;
        Word.Document document = application.Documents.Open("\\\\chca6037.eur.beluni.net\\a853725$\\Documents\\Forms.docx");
        //Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
        int IdxPara = 0;
        foreach (Word.Paragraph parag in document.Paragraphs)
        {
            Word.Range parRng   = parag.Range;
            int myErrors = 0;
            IdxPara++;
            myErrors = parRng.GrammaticalErrors.Count;
            if (myErrors > 0)
            {
                Console.WriteLine("Paragraph {1} has {0} error(s)", myErrors, IdxPara);
            }
            else
            {
                Console.WriteLine("Paragraph {0} has no error(s)",IdxPara);
            }
        }
        document.Close(false);
        application.Quit();
    }

Open in new window

Regards
0
 

Author Comment

by:mannevenu26
ID: 40432528
Very good Solution iam going to close the question ..

Thank you...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question