Word document will not open; no errors

Using Aspose.Words version 3.3 and this is in a Windows app.

The last line of the following code is ignored, no errors.

===========================

'Create and execute the mailmerge, it produces a document in memory.

Dim doc As Document = Execute()

'Once we have a document, we can save it to a file and send it to the client browser.

doc.Save("StudentNameTags.doc", SaveFormat.FormatDocument)

'Open the document in MS Word

Dim studentNameTagsDocument As Document = New Document(studentNameTagsFilePath) 'this line is ignored

===========================

The document is built fine, I just can't open it after I save it.

Please attach the document. I will check what’s wrong with it.

Here’s my code…

Please also attach the initial and the resulting document.

Here is the template for the mail merge and the resulting document that is created successfully but will not open.

File StudentNameTags.doc opens correctly in my MS Word 2003 and MS Word Viewer 2003.

It hangs up in MS Word 2000 and is rendered incorrectly by MS Word 97 Viewer. I have not tested it with MS Word 2002.

Which version of MS Word are you using?

This problem is logged to our defect base as Issue #894. We will be able to deal with it in the next 2-3 weeks.

I have found that file starts to open correctly after being resaved in MS Word 2003. I've attached the fixed file.

Just so that you know, I’m using Word 2003 and I can open it manually but I can’t open it programatically.

File "StudentNameTags.doc" opens by Aspose.Words correctly in my test..

Try to state file path explicitly when saving:

doc.Save(studentNameTagsFilePath , SaveFormat.FormatDocument)

This is an old thread, but i noticed the same problem with one of the generated documents with aspose. MS Word 2000 hangs when i try to open document. Original template is opened normaly, and also generated documents in pdf, html, and aspose viewer looks ok.
I use version 3.7.1.

I attached the template from which i create the document.

Thanks for reporting this problem to us.

I have found that template indeed opens normally in MS Word 2000. However, it displays strange behavior in MS Word 2003 - the openning time is very slow and the File | Save As menu does not work. Resaving the template file in either Word 2000 or Word XP does not help the situation.

So, there must be something incorrect in this document. I have logged this problem to our defect base as issue #1126. We will look at this issue by the time of the next release and maybe some fix wil made to correct the problem. Please also provide the code snippet and resulting document which fails to load in MS Word.

Best regards,

Ok i do not know about opening the template in 2003 but, parsing it with aspose words and then opening parsed document hangs word 2000

I attached a result document generated from the previusly attached template.

Previusly attached template is a bit different then the original template that was problematic. I removed heads, footers, all the text outside from tables, and all the tables except one to reduce size of a problem. If i removed that last table (which i left in the attached template) there was no problem showing te result document in word 2000.

The document failed to be attached somehow. Please reattach it.

attacment…

The issue no longer appears with Aspose.Words 4.0. Please try working with your documents using the newest version.

Also note that there is a new property Document.IsTemplate in ASpose.Words 4.0 that you might find useful.

Best regards,