Trying to print a flowdocument. I print the document within a foreach and change the name every pass through. My problem is that after i print it out the first time the name does not change the second/etc. time through the loop. Why is this? Here is the code
PrintDialog p = new PrintDialog();
if (p.ShowDialog().Value == true)
{
foreach (CustCnt c in customerContacts)
{
((TextBlock)doc.FindName("Name")).Text = c.Name;
SelectCOADelivery("FaxLabel", "FaxNumber", c.CheckBox17, c.FaxNum, doc);
SelectCOADelivery("EmailLabel", "Email", c.CheckBox16, c.EMailAddress, doc);
SelectCOADelivery("LoadLabel", null, c.CheckBox18, null, doc);
((TextBlock)doc.FindName("FaxNumber")).Text = c.FaxNum;
((TextBlock)doc.FindName("Email")).Text = c.EMailAddress;
p.PrintDocument(((IDocumentPaginatorSource)doc).DocumentPaginator, "Baker Data");
}
}