I have an Excel sheet that actually is a letter.
On the same sheet I have a button that get the next address from a database (in Excel) and the contents on the sheet changes automatically.
I'm supposed to print out (actually save) the letter as an PDF-file (Acrobat installed) and what happens is that the PDF-file is saved to a specific folder on the HD. All this is very simple part from one thing. I have to manually change the name of the PDF-file before I save it, otherwise it will use the same name every time and I want it to pick up the unique name from a cell on the sheet (that changes every time I run the macro "Next customer").
What I want is a sub that "print out" to a PDF-file and grab the name for the file from a range called "FileName". Additionally I might add the sub "Next customer" to the end of this sub and then pop-up a MsgBox asking if I want to print out this one aswell.
I started to look at:
expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)
But I got stuck at "PrToFileName" and expressions etc.
Does anyone have a solution to my problem ?