Programmatically call microft print to pdf and dynamically pass filepath and filename information

Martin, Brian 1 Reputation point
2022-11-29T20:19:04.85+00:00

I have a set of documents that I would like to save as pdf files and place in different network folders. Is there a way to do this programmatically using vba or C#, etc

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 83,021 Reputation points
    2022-11-29T20:33:36.21+00:00

    Is there a way to do this programmatically using vba or C#, etc

    You can use PrintDocument.PrinterSettings, like :

    PrintDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF";
    PrintDocument.PrinterSettings.PrintToFile = true;
    PrintDocument.PrinterSettings.PrintFileName = "pdf_filename";

    1 person found this answer helpful.
    0 comments No comments