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 1011227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:12:10+00:00 2026-05-16T09:12:10+00:00

We are currently processing big word documents in c# program. During processing i am

  • 0

We are currently processing big word documents in c# program.
During processing i am getting message “Microsoft Windows has stopped working”.

The program reads the word document based on the comments added to the document and processes the images and other text in the document and also creates lot of independent word documents with content from the original document.

What is the reason for the problem? Is this because word documents are created, opened and closed so frequently?

Program Steps:
1) Copy the content referred by the comment in the doc to clipboard

    comment.Scope.CopyAsPicture();

2) Then process convert the content to “html” or “plain” image by

    public String _GetContentFromClipboard()
    {
        String text = "";
        if (Clipboard.GetData(DataFormats.Html) != null)
        {
            text = Clipboard.GetData(DataFormats.Html).ToString();
        }
        else
        {
            IDataObject iData = Clipboard.GetDataObject();
            if (iData.GetDataPresent(DataFormats.Bitmap))
            {
                Image image = iData.GetData(DataFormats.Bitmap, true) as Image;
                String imageFile = Guid.NewGuid().ToString() + ".jpg";
                image.Save(imageFile, System.Drawing.Imaging.ImageFormat.Jpeg);
                text = "<img src=\"" + imageFile + "\" width=\"" + image.Width + "\" height=\"" + image.Height + "\" />";
            }
        }
        return text;
    }

3) Also sometimes save the content from the clipboard to new word document

    public String SaveClipboardContentToDoc(bool removeComments)
    {
        Object docName = GeneralUtil.GetTempFileWithoutExtension() + ".docx";
        Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();

        Microsoft.Office.Interop.Word.Document oDoc = new Microsoft.Office.Interop.Word.Document();

        oDoc = oWord.Documents.Add(ref missingObj, ref missingObj, ref missingObj, ref missingObj);
        oWord.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
        oWord.Visible = false;
        oDoc.ActiveWindow.Selection.Paste();
        if (removeComments == true)
        {
            foreach (Comment selectionComment in oDoc.Comments)
            {
                selectionComment.Delete();
            }
        }
        oDoc.SaveAs(ref docName, ref missingObj,
                    ref missingObj, ref missingObj, ref missingObj, ref missingObj, ref missingObj,
                    ref missingObj, ref missingObj, ref missingObj, ref missingObj, ref missingObj,
                    ref missingObj, ref missingObj, ref missingObj, ref missingObj);
        ((Microsoft.Office.Interop.Word._Document)oDoc).Close(ref missingObj, ref missingObj, ref missingObj);
        ((Microsoft.Office.Interop.Word._Application)oWord).Quit(ref missingObj, ref missingObj, ref missingObj);
        return docName.ToString();
    }

The initial warning message is

"Microsoft Windows has stopped working"
Windows can check online for a solution to the problem and try to recover your information.
Check online for a solution and close the program
close the program
Debug the program

Then clicking on debug leads to " "An unhandled win32 execption occurred in WINWORD.EXE [7372]"
  • 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-05-16T09:12:11+00:00Added an answer on May 16, 2026 at 9:12 am

    Well, your code bombed Word. That doesn’t happy very often, but Word is rather a large beast and probably contains thousands of bugs that haven’t been found yet. You’ll get no help from the exception itself, it happens inside the core code. Even if you did have the source code for Word, you’d probably still have a helluva time finding out exactly what went wrong.

    Word is supported, you can call Microsoft Support. After you went through the outer support layers, you’ll eventually get a support engineer assigned to your problem that knows Word well and can diagnose the cause. To get through those outer layers, it is very important that you have a good repro available. The simplest program that can trip this crash on any machine. Once you got that, have your credit card ready and call them. They’ll give you a URL to upload your repro code. Be sure to stay in touch with them as your case traverses the support levels, you need to be proactive to ensure they stay on the case. Count on several weeks if it needs to get all the way. You’ll get your money back if they determine it is a bug in Word instead of your code.

    Fwiw, working on getting the simple repro is usually a good way to find out what, if anything, is wrong with your code. Good luck.

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

Sidebar

Related Questions

Currently I'm working on the project that does processing files from source directory in
I am currently working on a sort of image processing tool that will contain
Sometimes procedural programming is absolutely unavoidable when processing data. I am currently working on
I have a big pixel processing function which I am currently trying to optimize
I am currently working on a very large legacy MFC MDI application. It has
I am currently processing text/html data and I wish to store my results in
I am currently writing a bulk processing algorithm for pitch detection in audio being
We are implementing edi order processing and are currently about to check how we
I'm currently trying to teach myself PHP by doing a small image-processing type project
I am currently implementing a credit card processing script, most as provided by the

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.