Please can someone help with a problem opening a Word2003 file in code using Microsoft.Office.Interop.Word
?
My code is below. The document is created fine and if I pause the code after creating it I can open the file via explorer. The code freezes on the final line. At this point one can see a file locking metafile appear in explorer as well as the original. There is no error generated that I can see. Maybe there is an invisible dialog but otherwise I'm stumped. Thanks in advance.
Firstly write a byte array to a file
var tmpFile = @"C:\donkey.doc"; File.WriteAllBytes(tmpFile, binary_document);
Open the file as a document object of some type
Application app = new Application(); Document CurrDoc = app.Documents.Open(@"C:\donkey.doc");
Solution to freeze was re-installing Word2003 although I have actually abandoned the approach altogether due to the server issues identified here http://support.microsoft.com/kb/257757. Thanks for all help.