Hi there!
I suggest you drop using Office interop in favor of OpenXML SDK
The latter needs a little bit of learning and supports only Office 2007+ documents, but there are lots of code samples over the Internet. Also, OpenXML SDK does not require Office installed on the machine, which excludes the influence of Office's own bugs on your program. I recommend investing some time in studying OpenXML SDK, this will surely pay off to you.
Can't access Interop properties from C#
Hello everybody,
I'm encountering a problem with a C# .NET 4.8 project, while trying to use Office interop. If I use Interop.Microsoft.Office.Interop.Excel, Interop.Microsoft.Office.Interop.Outlook or Interop.Microsoft.Office.Interop.Word, I can not access any properties. The only way to get any informations from the COM object is to use some methods.
Example :
Microsoft.Office.Interop.Word.Application _wordApplication;
var documents = _wordApplication.Documents;
This is not working anymore
Microsoft.Office.Interop.Word.Application _wordApplication;
var documents = _wordApplication.get_Documents();
This is working right now but encounters other problems.
Any advice to why those interops suddenly don't expose their properties ?
Thank you !
1 answer
Sort by: Most helpful
-
Artemiy Moroz 271 Reputation points
2022-01-25T12:08:52.56+00:00