Jump to content

Printer frustrations


LaRetta

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

Recommended Posts

One way around this is to stop your FM script at the point where it executes the VBscript and let the VBscript call a FM script when it's done. That solves all your timing issues. Makes the VBscript a bit longer though.

Wim is right but, you can only call a Filemaker Script from a file that is hosted locally. So, if you want to execute a Fm script in a file hosted by FM Server you must build a small file that is hosted locally and create a script in the local file to trigger the script in the hosted file.

VBscript can be used to check for the local file and copy it from a network drive if it does not yet exist.

Example:

Set oFileObj = CreateObject("Scripting.FileSystemObject")

If oFileObj.FileExists("C:Documents and SettingsaholtzapfelMy DocumentsFM_MarketingTransfer.fp7") then

Else

oFileObj.CopyFile "Filemaker1fm_docsFM_MarketingTransfer.fp7", "C:Documents and SettingsaholtzapfelMy DocumentsFM_MarketingTransfer.fp7"

Wscript.Sleep 2000

End If

Link to comment
Share on other sites

  • 1 month later...

Hi Guys,

I managed to run the vbscript. It does changes the printer in the registry and changes the windows default printer, but it still doesnt change the printer in the FM. Any help?

The VBscript is as follows:

Set WshNetwork = CreateObject("WScript.Network")

set WshShell = CreateObject("WScript.Shell")

Serv = "DBS-EMAC"

Printhere = "MFC-9160"

AddSettings = ",winspool,DBS-EMACMFC-9160"

FullPrinterName = ("" + Serv + "" + printhere)

WshNetwork.SetDefaultPrinter FullPrinterName 'This sets the default printer for the computer NOT JUST FILEMAKER

WshShell.RegWrite ("HKEY_CURRENT_USERSoftwareFileMakerFileMaker Pro8.0preferencesprinter"),FullPrinterName +

AddSettings,"REG_SZ"

WScript.Quit

Link to comment
Share on other sites

  • 1 month later...

Here is a sample file (It is a .fp7 file) for changing printers in FMPro on XP or Vista. It does this by creating a VBS script and running it. It will create the printer if it is not already set-up for that user. After running the set printer script in this file a Page Setup(No Dialog) needs to be done in the file you are printing from so it will reconize the printer being changed. this has been tested and works on FMpro 8.0 and 8.5 on xp and vista. It should work on other versions but has not been tested.

(I know this is not a timely response to this post but I thought this might be usefull to someone out there.)

Change_Create_Printers_xp___Vista__zipped__Folder.zip

Edited by Guest
Link to comment
Share on other sites

This topic is 6160 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.