Resources for IT Professionals > Forums Home > Using Forums Forums > Off-Topic Posts (Do Not Post Here) > Spell checker not working on development server (IIS) in ASP.NET 2.0/3.5
Ask a questionAsk a question
 

QuestionSpell checker not working on development server (IIS) in ASP.NET 2.0/3.5

  • Friday, November 06, 2009 3:21 PMHemangiK Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    I am using following function for spell checker
    public
    void fSpellCheck(TextBox tBox, Label lLbl)

    {

     

    int iErrorCount = 0;

    Microsoft.Office.Interop.Word.Application app =

    new Microsoft.Office.Interop.Word.Application();

     

    if (tBox.Text.Length > 0)

    {

    app.Visible =

    false;

     

    // Setting these variables is comparable

     

    // to passing null to the function.

     

    // This is necessary because the C# null

     

    // cannot be passed by reference.

     

    object template = Missing.Value;

     

    object newTemplate = Missing.Value;

     

    object documentType = Missing.Value;

     

    object visible = true;

     

    object optional = Missing.Value;

    _Document doc = app.Documents.Add(

    ref template,

     

    ref newTemplate, ref documentType, ref visible);

    doc.Words.First.InsertBefore(tBox.Text);

    Microsoft.Office.Interop.Word.ProofreadingErrors we = doc.SpellingErrors;

    iErrorCount = we.Count;

    doc.CheckSpelling(

    ref optional, ref optional, ref optional,

     

    ref optional, ref optional, ref optional, ref optional,

     

    ref optional, ref optional, ref optional,

     

    ref optional, ref optional);

     

    if (iErrorCount == 0)

    lLbl.Text =

    "Spelling OK. No errors corrected ";

     

    else if (iErrorCount == 1)

    lLbl.Text =

    "Spelling OK. 1 error corrected ";

     

    else

    lLbl.Text =

    "Spelling OK. " + iErrorCount +

     

    " errors corrected ";

     

    object first = 0;

     

    object last = doc.Characters.Count - 1;

    tBox.Text = doc.Range(

    ref first, ref last).Text;

    }

     

    else

    lLbl.Text =

    "Textbox is empty";

     

    object saveChanges = false;

     

    object originalFormat = Missing.Value;

     

    object routeDocument = Missing.Value;

    app.Quit(

    ref saveChanges, ref originalFormat, ref routeDocument);

    }

    My system get slow down and hangs and word spell checker dialog box does not open but it shows in task manager.(WINWORD.exe)

    I gave all permission through DCOMCONFIG, also set <identity impersonate="true"> in web.config. But still i face same problem.

    I had gone through below link,
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/006cbbac-101a-40ea-ae16-d59a7a2da8b1

    and change key{00020906-0000-0000-C000-000000000046} of Word.Application using regedit.
    Now i got an error 'There is insufficient memory. save the doucment now.' 

    Please anyone help me ASAP.

    • Moved byCindy MeisterMVPFriday, November 06, 2009 9:05 PMnot VSTO-related (From:Visual Studio Tools for Office)
    •  

All Replies

  • Friday, November 06, 2009 9:05 PMCindy MeisterMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    The VSTO forum's Please Read First message describes what VSTO is, and what the VSTO forum supports. Automating Office from a web application definitely falls outside this forum's area of support. You'll find links in that message to venues for non-VSTO, Office-related messages.


    Cindy Meister, VSTO/Word MVP