private void OpenSpool(string filename) { // open file OutputDevice spool = new TextWriterOutputDevice(new StreamWriter(filename)); Application.SetOutDevice(OpenStackedDevice(outStack, spool)); Application.SetErrorDevice(OpenStackedDevice(msgStack, spool)); Application.Error.WriteLine("-- open spool at " + DateTime.Now); }