G Guest May 7, 2004 #1 I am looking for a way to change an individuals (users) default printer to another printer. Print a file and then reset back to the users original printer. Any suggestions?
I am looking for a way to change an individuals (users) default printer to another printer. Print a file and then reset back to the users original printer. Any suggestions?
K Ken Tucker [MVP] May 7, 2004 #2 Hi, Add a reference to system.management.dll Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim mo As Management.ManagementObject moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Printer") moReturn = moSearch.Get For Each mo In moReturn Dim objReturn As Object Debug.WriteLine(mo("Name")) mo.InvokeMethod("SetDefaultPrinter", objReturn) Next Ken
Hi, Add a reference to system.management.dll Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim mo As Management.ManagementObject moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Printer") moReturn = moSearch.Get For Each mo In moReturn Dim objReturn As Object Debug.WriteLine(mo("Name")) mo.InvokeMethod("SetDefaultPrinter", objReturn) Next Ken