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

Developer technologies | Visual Basic for Applications
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 90,686 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

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.