none
Word Automation 2010 : PrintOut Append COMException 0x800A141E File Write error RRS feed

  • Question

  • Hi,

     I have an application that is used since 2009 which prints word documents using the PrintOut Method.

    Everithing was working normally until  last month. Since last month we Have a bug when the PrintOut method is called with the "Append" argument to true.

     I think it could be happening since a word or windows update but I dont know which one.

    The exact error message (in french sorry) is :

     System.Runtime.InteropServices.COMException (0x800A141E): Impossible d’écrire dans le fichier C:\Users\Echeances\AppData\Local\Temp\1\ImpressionDocumentsMAA.prn.
       à Microsoft.Office.Interop.Word.DocumentClass.PrintOut(Object& Background, Object& Append, Object& Range, Object& OutputFileName, Object& From, Object& To, Object& Item, Object& Copies, Object& Pages, Object& PageType, Object& PrintToFile, Object& Collate, Object& ActivePrinterMacGX, Object& ManualDuplexPrint, Object& PrintZoomColumn, Object& PrintZoomRow, Object& PrintZoomPaperWidth, Object& PrintZoomPaperHeight)

    It can be translated in Impossible to write in the file .....

    I have checked, the file is correct and the process have every rights on it and no handle is still opened on the file.

    The thing that is more curious is the first call to PrintOut with Append False create the prn file but the second call with append to true doesnt work.

    Is someone experiencing the same problem ?

    Tuesday, January 21, 2014 12:56 PM

Answers

  • Hi,

    >> The thing that is more curious is the first call to PrintOut with Append False create the prn file but the second call with append to true doesnt work.<<
    Did you mean that you get the error message only when you set the append parameter to true?
    I failed to reproduce the issue with code below:

    using Word=Microsoft.Office.Interop.Word;
    
    namespace PrintDocument
    {
        class Program
        {
            static void Main(string[] args)
            {
                Word.Application app = new Word.Application();
                
                Word.Document doc=app.Documents.Open(@"C:\Users\user\Desktop\testPrint.docx");
                Console.WriteLine("begin print textpring...");
                doc.PrintOut(false, false, Type.Missing, @"C:\Users\user\Desktop\PrintedDocument.prn");
                doc.Close();
                doc = app.Documents.Open(@"C:\Users\user\Desktop\testPrint1.docx");
                Console.WriteLine("begin print textpring1...");
                doc.PrintOut(false, true, Type.Missing, @"C:\Users\user\Desktop\PrintedDocument.prn ");
                doc.Close();
                Console.ReadLine();
            }
        }
    } 
    

    Have you tried to modify the path of output file to see whether this issues was caused by specific document?

    In addition, would you mind sharing with us some code snippet to help us trouble shooting this issue?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 22, 2014 9:46 AM
    Moderator
  • Hi neothoms,

    I change the default printer to Microsfot Xps Document Writer and still failed to reproduce this issue. My test environment  Word 14.0.7015.1000 (64-bit).

    I suggest you update the Word to the latest version to see whether the issue is fixed.

    If not, since the issue is complex, I suggest you to open phone support case with Microsoft as we need to troubleshoot the issue further which is not possible via this Forum Support.

    To create phone support case, you may contact Microsoft Customer Central on 1800-936-4900 or alternately you may also visit http://support.microsoft.com/oas

    Best regards
    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 23, 2014 12:47 PM
    Moderator

All replies

  • Hi,

    >> The thing that is more curious is the first call to PrintOut with Append False create the prn file but the second call with append to true doesnt work.<<
    Did you mean that you get the error message only when you set the append parameter to true?
    I failed to reproduce the issue with code below:

    using Word=Microsoft.Office.Interop.Word;
    
    namespace PrintDocument
    {
        class Program
        {
            static void Main(string[] args)
            {
                Word.Application app = new Word.Application();
                
                Word.Document doc=app.Documents.Open(@"C:\Users\user\Desktop\testPrint.docx");
                Console.WriteLine("begin print textpring...");
                doc.PrintOut(false, false, Type.Missing, @"C:\Users\user\Desktop\PrintedDocument.prn");
                doc.Close();
                doc = app.Documents.Open(@"C:\Users\user\Desktop\testPrint1.docx");
                Console.WriteLine("begin print textpring1...");
                doc.PrintOut(false, true, Type.Missing, @"C:\Users\user\Desktop\PrintedDocument.prn ");
                doc.Close();
                Console.ReadLine();
            }
        }
    } 
    

    Have you tried to modify the path of output file to see whether this issues was caused by specific document?

    In addition, would you mind sharing with us some code snippet to help us trouble shooting this issue?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 22, 2014 9:46 AM
    Moderator
  • Hello,

    I have found what is causing the error. I was using your code much more simple than all my application.

     When the default printer is the Microsoft Xps Document writer on the server the error happens but when it is another printer it does not.

    Is this enough for you to reproduce?

    Wednesday, January 22, 2014 10:31 PM
  • Hi neothoms,

    I change the default printer to Microsfot Xps Document Writer and still failed to reproduce this issue. My test environment  Word 14.0.7015.1000 (64-bit).

    I suggest you update the Word to the latest version to see whether the issue is fixed.

    If not, since the issue is complex, I suggest you to open phone support case with Microsoft as we need to troubleshoot the issue further which is not possible via this Forum Support.

    To create phone support case, you may contact Microsoft Customer Central on 1800-936-4900 or alternately you may also visit http://support.microsoft.com/oas

    Best regards
    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 23, 2014 12:47 PM
    Moderator