views:

18

answers:

1

I am getting this stacktrace:

System.Runtime.InteropServices.COMException (0x800A13E9): Word ðú÷ì ááòéä.
   at Microsoft.Office.Interop.Word.Documents.Add(Object& Template, Object& NewTemplate, Object& DocumentType, Object& Visible)
   at Crm.DocumentGeneration.Printing.DocumentsPrinter.MergeDocuments(ApplicationClass& wordApp, IEnumerable`1 printDataItems, String tempDirectory, String template) in C:\Work\Danel.Nursing\Crm.DocumentGeneration.Printing\DocumentsPrinter.cs:line 249

After googling a bit it seems that COMException (0x800A13E9) is out of memory exception but there is enough memory on the server to launch a spaceship.
Here is the function call:

Document document = wordApp.Documents.Add(ref defaultTemplate, ref missing, ref missing, ref missing);

Nothing is null or invalid with defaultTemplate, I checked.

+2  A: 

Sorry 'bout that 1MB reference, Danel... I just had to jump on that one.

When automating Office Applications make sure, that you use a local account on the server with permissions for the Word COM+ object as well as the documents you are trying to work on.
There are several posts relating to your problem pointing at the account issue:

moontear