Manually opened Word files are being closed when files are opened using Microsoft.Office.Interop.Word.dll (15.0.0.0). How can I prevent this?

Shintaro Yoshida 0 Reputation points
2024-10-04T00:25:07.69+00:00

I have a C# program that uses Microsoft.Office.Interop.Word.dll (15.0.0.0) to repeatedly open Word files, gather information, and close them. However, while my application is running in the background, if I try to manually open a Word file from Explorer or another method, the file opens briefly but then closes unexpectedly.

Does anyone have a solution for this issue?

Conditions:

  1. The self-made C# application uses Microsoft.Office.Interop.Word.dll (15.0.0.0) to open Word files.
  2. I attempt to manually open a Word file using Explorer (or similar methods).
  3. Closing the Word file opened by the application also causes the manually opened file to close.

If the Word file is opened manually before the C# application starts, the manually opened file is not closed, as it seems to be attached to the first Word process that was already running.

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
4,890 questions
Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
842 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,915 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,896 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
923 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.