Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to use FileMaker Print from a VB script

Featured Replies

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

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

  • Author

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

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

  • Author

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.