Solved

Check Grammer using C#

Posted on 2014-10-19
2
124 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
2 Comments
 
LVL 49

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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