Jump to content
Server Maintenance This Week. ×

How to use FileMaker Print from a VB script


This topic is 6852 days old. Please don't post here. Open a new topic instead.

Recommended Posts

We are using FileMaker Pro 6 and we have a virtual printer that creates PDF files.

What I want to be able to do is this: A VB Script should be able to access FileMaker (already running with the target database open), perform a "Find" to select a set of desired records (already done with SQL), THEN activate a given layout and Print to a non-default printer (thereby creating the PDF file).

The parts I can't figure out is how get VB Script to tell FileMaker to print a given layout to a non-default printer.

I've looked at the FileMaker ActiveX help. I could call the DoFMScript () method, but there' sno way to tell a script to remember a non-default printer to print to.

Any ideas? Thanks!

Edited by Guest
Link to comment
Share on other sites

Hi Joe,

I have no experience whatsoever with VB script but AFAICS DoFMScript() calls a script in the Filemaker file. If so, you can add a Print Setup[Restore,No dialog] script step to that script. Exit Scriptmaker, go to File/Print Setup and change to the PDF-printer. Now go back into your script, click OK, and in the dialog that then pops up, check replace "Print Setup". That script should now use the PDF-writer when it is called from your VB-script.

HTH,

Peter

Link to comment
Share on other sites

Hi, Peter,

That actually worked, but in a slightly different way. Although the Print Setup[Restore,No dialog] DOES NOT remember the printer selection, the FileMaker application DOES, even between invocations. So, I can leave the Windows Default printer set to whatever. But once I choose "PDF Writer" in FileMaker, it will remember it indefinitely.

Thanks agains so much for your help,

Joe

Link to comment
Share on other sites

Hm, I've tested it again and it seems you are correct. Strange way for the "restore" option to (not) function.

FYI, in FM7 you can explicitly specify the print setup that should be used by the script, in stead of the clumsy "Keep/replace" dialog. This is also true for the other script steps that were previously set by keep/replace (sort, find, import, export), which is a huge plus in my opinion.

Regards,

Peter

Link to comment
Share on other sites

I guess the reason the "restore" option does not remember the printer selection is because it might cause problems in networked FileMaker applications, where each PC might have a different printer it wants to use. So they made the "default" printer selction local to the local PC installation.

Link to comment
Share on other sites

This topic is 6852 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.