private void btn_PrintMacro_Click(object sender, EventArgs e)
{
try
{
string dir = @"C:\slim\slimyyyy"
if (Directory.Exists(dir))
{
string[] pdf_specFiles = Directory.GetFiles(dir);
if (pdf_specFiles.Length > 0)
{
foreach (object item in listBox1.Items)
{
foreach (string file in pdf_specFiles)
{
string fileName = Path.GetFileName(file);
if (fileName == item.ToString())
{
PrintDocument(Path.GetFullPath(file));
}
}
}
}
}
}
catch (Exception )
{
MessageBox.Show("There is a possibility that one or more of Spec file - (s) is not in the said Directory ok.");
}
}