WhoCanDo Posted February 7, 2024 Share Posted February 7, 2024 Hi, As far as I am aware, Vectorscript can't print a worksheet to a pre-defined filename - I'm printing to the "Microsoft Print to PDF" printer. Therefore, can anyone come up with an idea to copy text to the Windows clipboard so that it can be pasted into the filename box when printing it? With VS's "Print ('Worksheet Name')", Windows saving convention pops up, but the filename is blank. Since I already have files of the suffix format that I want, I would just click on an existing file and that would prefill the blank filename area, and then I want to paste in the prefix. eg. suffix = "This file.pdf", prefix = "Despatch List ", result = "Despatch list This file.pdf" Quote Link to comment
WhoCanDo Posted October 29, 2024 Author Share Posted October 29, 2024 It's been a while since asking this question. I'm guessing that VW can't do this, or no one else has a need to do this. However, if anyone else is hunting for an answer, I have a work around. Since you already know the file name you want to create, use ReWrite (DataFName); and Close (DataFName); to create a blank file or set of files ( I needed 5 exported worksheet PDF files ). Function ChangeLocalFileName (Prefix : string) : string; var FName : string; begin FName := Concat (Copy (GetFPathName, 1, Pos (GetFName, GetFPathName) - 1), Prefix, GetFName); FName := Concat (Copy (FName, 1, Pos ('.vwx', FName) - 1), '.pdf'); ChangeLocalFileName := FName; end; begin ReWrite (ChangeLocalFileName ('WORKSHEET1 ')); Close (ChangeLocalFileName ('WORKSHEET1 ')); end; Then, when Window's saving convention pops up, just click the appropriate file name created previously to overwrite it. It sure saves time and RSI. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.