CopySettingsForAllUsers

 

Copies the current user’s printer settings to every user on the system. Requires administrator privileges.

 

CopySettingsForAllUsers(szPrinterName As String) As Boolean

 

Input value szPrinterName:            -The name of the printer that should be copied.

 

Return value:                                    -True on success, otherwise False.

 

NOTE: For 32-bit applications, use pDevMode as Integer, instead of Long.

 

 

// create a DEVMODE structure
long pDevMode = BlackIceDEVMODE.CreateDefaultSettings(printerName);

 

// change the settings
BlackIceDEVMODE.SetPaperSize((short)paperCode, pDevMode);

...

 

// save the settings for the current user and release the structure
BlackIceDEVMODE.SaveBlackIceDEVMODE(printerName, pDevMode);
BlackIceDEVMODE.ReleaseBlackIceDEVMODE(pDevMode);

 

// copy the current user's settings to all users on the system
BlackIceDEVMODE.CopySettingsForAllUsers(printerName);