Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:37:22+00:00 2026-06-05T16:37:22+00:00

I am using Microsoft.Office.Interop.Word.ApplicationClass to read a set of Word documents. I am able

  • 0

I am using Microsoft.Office.Interop.Word.ApplicationClass to read a set of Word documents. I am able to read them fine and all, but I noticed that the process that is used to read these docs never actually ends according to the Windows Task Manager.

From what I have Google’d, there doesn’t seem to be anyone else who has this issues, which leads me to believe that I either am doing something fundamentally wrong, or I lack the ability to effectively phrase my issue for a Google search.

I am relatively new with C#, so I suspect the former. Find below the code that I am using to create the instance of the document ‘reader’.

private void readDoc(string docPath)
{
    Word.ApplicationClass wordApp = new Word.ApplicationClass();
    object nullObj = System.Reflection.Missing.Value;
    object roObj = true;
    object objFile = docPath;

    try
    {
        Word.Document doc = wordApp.Documents.Open(ref objFile,
            ref nullObj, ref roObj, ref nullObj, ref nullObj, ref nullObj,
            ref nullObj, ref nullObj, ref nullObj, ref nullObj, ref nullObj,
            ref nullObj, ref nullObj, ref nullObj, ref nullObj, ref nullObj);
        doc.ActiveWindow.Selection.WholeStory();
        doc.ActiveWindow.Selection.Copy();
        IDataObject tmpData = Clipboard.GetDataObject();
        string docText = tmpData.GetData(DataFormats.Text).ToString();

          (...)
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Data);
    }
}

The rest of the try block deals with the string docText and doesn’t involve wordApp or doc, thus I have not included it in the code segment.

There doesn’t seem to be a .Dispose() function for the Word.ApplicationClass so I am at a bit of a loss here.

Edit- Sorry, the implied question here is: How can I end the process programmatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:37:25+00:00Added an answer on June 5, 2026 at 4:37 pm

    Try adding the following at the end of readDoc():

    wordApp.Quit(ref nullObj, ref nullObj, ref nullObj);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working with vb.net and microsoft word using Microsoft.Office.Interop.Word and everything is fine. My
Consider this code: using Microsoft.Office.Interop.Word; ApplicationClass _application = new ApplicationClass(); Can I get the
I am using Microsoft.Office.Interop.Word to access Word documents through c#. Some of the Word
I have an object created in memory using Microsoft.Office.Interop and Microsoft.Office.Word and with all
I am using Interop.Microsoft.Office.Interop.Word.dll to dynamically build a Word document in C#. Does anyone
I'm creating a Word 2010 document using C# and Microsoft.Office.Interop.Word . Using the Range.Paste
I want to detect Empty paragraphs in Word Document using Microsoft.Office.Interop.Word. Suppose, if my
We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I
How to make horizontal orientation (album) word document using Microsoft.Office.Interop.Word
I Opened/Created a new Word document dynamically on FormLoad using: using Word = Microsoft.Office.Interop.Word;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.