locked
infopath application hangs when I print multiple forms externally using JScript RRS feed

  • Question

  • I am printing multiple infopath forms with JScript (the follwing C# code generates the client side JScript):

            script += @"var oApp = new ActiveXObject(""InfoPath.Application""); ";
    script += @"var oDoc = oApp.XDocuments.Open(MyDocPath+""" + clientSubFolderAndFilename1 + @"""); ";
    script += @"oDoc.PrintOut(); ";
    script += @"oDoc.View.Window.Close(); ";

    script += @"var oDoc = oApp.XDocuments.Open(MyDocPath+""" + clientSubFolderAndFilename2 + @"""); ";
    script += @"oDoc.PrintOut(); ";
    script += @"oDoc.View.Window.Close(); ";

    script += @"var oDoc = oApp.XDocuments.Open(MyDocPath+""" + clientSubFolderAndFilename3 + @"""); ";
    script += @"oDoc.PrintOut(); ";
    script += @"oDoc.View.Window.Close(); ";
    etc..
            script += @"oApp.Quit(); " ;

    The problem is, Infopath seems to hang if I print more than 4 forms. Any idea? Is there an easy way to pause the script after each call to oDoc.PrintOut() and/or aApp.Quit() ?

    Thanks very much

    Monday, August 10, 2009 6:05 PM