I'm building a software to modify docx files using Microsoft.Interop.Word. Users can add text, tables and so on. When trying to SaveAs the document, I get a COM or a Cast error depending on the code I'm trying to use. If I try to close the document before saving, I [...] read more
I created a Word document through automation (Start Word, Open template, Saved it to .doc, Close document, Quit Word). After that I want to open this .doc-file in an TOleContainer: fOleContainer.CreateObjectFromFile(lTempFileName, False);. But a client of ours who uses Word 2010 (several machines, Windows 7 / Windows XP) gets an [...] read more
I'm currently using COM Interop in .NET to export the contents of a DataTable to Excel. It's a method I've been using for years, but the problem is that COM is sketchy and throws random, intermittent, untraceable exceptions. This hasn't been a huge issue, since it's always just been code [...] read more