Hello
I have made a program which when clicked on a option, will print the active word document to that selected printer. The problem is that it works fine on a terminal but won't work on the server. It does change the default printer to the one selected, but won't print out. Below is the code i am using:
Reference to: Microsoft Word 10.0 Object Library
Dim WdApp As Word.Application
On Error Resume Next
SetDefaultPrinter "\\LXXP13\Samsung ML-7050 Series PCL5e (Copy 1)"
Set WdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Err.Clear
Set WdApp = CreateObject("Word.Application")
End If
WdApp.ActiveDocument.PrintOut
WdApp.ActiveDocument.Close (yes)
Set WdApp = Nothing
And in a module i have:
Public Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "SetDefaultPrinterA" (ByVal PrinterName As String) As Boolean
Thanx for you help.
I have made a program which when clicked on a option, will print the active word document to that selected printer. The problem is that it works fine on a terminal but won't work on the server. It does change the default printer to the one selected, but won't print out. Below is the code i am using:
Reference to: Microsoft Word 10.0 Object Library
Dim WdApp As Word.Application
On Error Resume Next
SetDefaultPrinter "\\LXXP13\Samsung ML-7050 Series PCL5e (Copy 1)"
Set WdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Err.Clear
Set WdApp = CreateObject("Word.Application")
End If
WdApp.ActiveDocument.PrintOut
WdApp.ActiveDocument.Close (yes)
Set WdApp = Nothing
And in a module i have:
Public Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "SetDefaultPrinterA" (ByVal PrinterName As String) As Boolean
Thanx for you help.