Jump to content
Developer Wiki and Function Reference Links ×

Saving a pre-defined filename


WhoCanDo

Recommended Posts

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"

Link to comment
  • 8 months later...

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...