bookose.blogg.se

Enable printing word 2010
Enable printing word 2010










Public Declare Function StrLen Lib "kernel32" Alias "lstrlenA" (ByVal Ptr As Long) As Long Public Declare Function PtrToStr Lib "kernel32" Alias "lstrcpyA" (ByVal RetVal As String, ByVal Ptr As Long) As Long Public Declare Function EnumPrinters Lib "winspool.drv" Alias "EnumPrintersA" (ByVal flags As Long, ByVal name As String, _īyVal Level As Long, pPrinterEnum As Long, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long ' Used to see what printers are set up on the user, and to set a new network printer Here is the specific code I used: 'Define Printer to add and printer to deleteĬonst PrintPath = "\\prn001l0003\Colour04"Ĭonst PrintDeletePath = "\\prn001l0003\Colour02" This was designed and written for Word 2003 but has continued to work in Word 2010. I had this same problem a few years back, got around it by storing the current default print in a variable, changing the default printer to the one I need, printing, then changing the default printer back to users original default. ' but still this sub changes the user's system default printer. DoNotSetAsSysDefault = True line would solve this problem

enable printing word 2010

The problem is that it makes that printer ' This code correctly sets the printer to a specific color printer StrReturn = UCase(Left(strReturn, InStr(strReturn, ",") - 1)) IntReturn = GetProfileString("Windows", ByVal "device", "", _ ' This code successfully sets the document to print from Public Declare Function GetProfileString Lib "kernel32" _

enable printing word 2010

'Sub below to get the system default printer. 'it seems to work properly with the "SetDefaultPrinter" Thanks in advance!!! 'I found the code block below on the web. Any thoughts will be greatly appreciated. See the comments in the code for further explanation. I suspect the DoNotSetAsSysDefault in that sub is not working as intended, but I don't know what to do about it.

enable printing word 2010

Everything works, except that the SetColorPrinterEast Sub changes the user's system default printer, which I do not want. I've hacked together some code below from samples I've found on the web. In Word 2010, I'm trying to create a macro that sets the current printer to a specific color printer on our network, without making that printer the user's system default printer.












Enable printing word 2010