EDIT I have tried to reconstruct code I no longer have to show. I think it is just a klimitation of the printersetting class not exposing functionality that can be selected by using a dialog. It seems I should be able to configure and assign a printerSettings object to a PrintDocument and then print that PrintDocument...??? Am I not thinking right here or??
EDIT AGAIN I think all the setters sit of the printerSettings.DefaultPageSettings . This will allow me to modify the printersettings. I haven t proved it yet but will later
PrintDocument pd = new PrintDocument();
pd.DocumentName = "test.doc";
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.?? <- I want to set the printer setting here e.g. DL, A4, etc
pd.PrinterSettings = printerSettings;
pd.Print();
I have generate word mail merge documents in c# (cheques, letters, documents) but all of these require different printer settings (cheque = custom setting, letters = DL Env,documents= A4)
I have these settings saved and can access them when loading the printer preferences dialog but I would like to be able to build it into code instead of manually changing the printer settings. I ve looked around and it seems printer settings class should be it but I can t seem to get it to work.
example psuedo code of what I am trying to do
//create the mail merge
IList<Letter> letters = MailMerge.Create(enum.letters)
Printer.Print(letters) //<-- in here I am trying set the printing preferences to DL Env
//create the mail merge
IList<Document> docs = MailMerge.Create(enum.documents)
Printer.Print(docs) //<-- in here I am trying set the printing preferences to A4
any help appreciated.
thanks