Programmatically set filename and path in Microsoft Print to PDF printer

Can anyone help me with setting the output file path and file name in the Microsoft Print to PDF printer?

I can see how to do it in C# but not in Xojo?

Any help appreciated. :wink:

Ken.

How do you do it in C#?

https://stackoverflow.com/questions/33985624/programmatically-set-filename-and-path-in-microsoft-print-to-pdf-printer#34673975

But how to do in Win32 API?

Stupid idea but: Open Word, create a document, switch on the Macro Recorder and perform the actions you want to put into Xojo eg selecting the PDFPrinter, entering the values and creating the PDF. Switch of the recorder, hit Alt-F11 and view the recorded macro as VB code.

Edit: works -of course- only from a WordDoc object.

Thanks Alexander, I’ll give it a try. :wink: