R
RichW
I am using the XP PIA and .NET.
I have code that prints email messages to .pdf files - and things have
been running smoothly until I came across a small .pst file that had
some large messages. The code snippet is below.
I am wondering if there is any way to ensure a message is "fully
loaded" before I execute the .PrintOut method. This is unusual
because the .PrintOut method is a void - so nothing is returned.
Furthermore, I don't get any type of an error message; instead I get a
dialog box.
Ideally, if I could loop until a message property has the needed value
and then execute the method...
Any wisdom on this would be most appreciated.
Best,
- Rich
snippet
****************************************
// Print message if print setting is True
if (PFile.printJobID > 0)
{
try
{
string strPFName = PFile.printFname = strFileInfoID;
string PrintSubPath = PFile.printPath;
string strSubDir;
if (Counter.printCount == PRINTMAX)
{
sessionInit(MI.EntryID, PFile.folderPath);
return "Reset";
}
SetFilename(ref strPFName, ref PrintSubPath, out strSubDir);
PrintSubPath = strSubDir;
MI.PrintOut(); // Here is where the error is generated.
// Write record to PrintOutput table
strResult = pstutils.InsertPdf(PrintSubPath, strPFName,
System.Int32.Parse(strFileInfoID), PFile.printJobID);
}
catch (System.Exception ex)
{
WriteLogOutput("PDF Print Output error for message " + strEntryID +
CRLF
+ "From .pst file: " + PFile.fileName + CRLF
+ "Error message: " + ex.Message);
MI = null;
}
}
I have code that prints email messages to .pdf files - and things have
been running smoothly until I came across a small .pst file that had
some large messages. The code snippet is below.
I am wondering if there is any way to ensure a message is "fully
loaded" before I execute the .PrintOut method. This is unusual
because the .PrintOut method is a void - so nothing is returned.
Furthermore, I don't get any type of an error message; instead I get a
dialog box.
Ideally, if I could loop until a message property has the needed value
and then execute the method...
Any wisdom on this would be most appreciated.
Best,
- Rich
snippet
****************************************
// Print message if print setting is True
if (PFile.printJobID > 0)
{
try
{
string strPFName = PFile.printFname = strFileInfoID;
string PrintSubPath = PFile.printPath;
string strSubDir;
if (Counter.printCount == PRINTMAX)
{
sessionInit(MI.EntryID, PFile.folderPath);
return "Reset";
}
SetFilename(ref strPFName, ref PrintSubPath, out strSubDir);
PrintSubPath = strSubDir;
MI.PrintOut(); // Here is where the error is generated.
// Write record to PrintOutput table
strResult = pstutils.InsertPdf(PrintSubPath, strPFName,
System.Int32.Parse(strFileInfoID), PFile.printJobID);
}
catch (System.Exception ex)
{
WriteLogOutput("PDF Print Output error for message " + strEntryID +
CRLF
+ "From .pst file: " + PFile.fileName + CRLF
+ "Error message: " + ex.Message);
MI = null;
}
}