aholtzapfel Posted February 26, 2007 Posted February 26, 2007 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
Wim Decorte Posted February 27, 2007 Posted February 27, 2007 VBscript can call a script in a remotely hosted file, provided that file is already open in the local client. VBscript can't open a remotely hosted file, for that you need the trick with a local file.
Slamdunk Posted April 16, 2007 Posted April 16, 2007 Hi, I m still a novice with FM. Would appreciate if you could inform how to execute this vbscript from FM. (Step by step pls) Thanks,
Slamdunk Posted April 16, 2007 Posted April 16, 2007 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
aholtzapfel Posted June 8, 2007 Posted June 8, 2007 (edited) 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 June 8, 2007 by Guest
Recommended Posts
This topic is 6420 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 accountSign in
Already have an account? Sign in here.
Sign In Now