This can be done by changing the default printer using vba but it takes a
little bit of code. I will do my best to explain.
First create a new module in the vba editor in outlook (VbaProject.OTM), you
can set the name to anything you would like
at the very top (just below Option Explicit if it's there) paste the
following
Public Declare Function GetProfileString Lib "kernel32" _
Alias "GetProfileStringA" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long) As Long
Sub PrintGreen()
Dim strDefault As String
Dim WshNetwork As WshNetwork
Dim i As Integer
Dim myOlApp As Outlook.Application
Dim mySelection As Selection
Set myOlApp = Application
Set mySelection = myOlApp.ActiveExplorer.Selection
Set WshNetwork = CreateObject("WScript.Network")
strDefault = DefaultPrinter
WshNetwork.SetDefaultPrinter ("ENTER YOUR PRINTER NAME HERE!")
For i = mySelection.count To 1 Step -1
If mySelection.Item(i).Class = olMail Then mySelection.Item(i).PrintOut
Next i
WshNetwork.SetDefaultPrinter (strDefault) ' restore default
End Sub
Public Function DefaultPrinter() As String
Dim strReturn As String
Dim intReturn As Integer
strReturn = Space(255)
intReturn = GetProfileString("Windows", ByVal "device", "", _
strReturn, Len(strReturn))
If intReturn Then
strReturn = UCase(Left(strReturn, InStr(strReturn, ",") - 1))
End If
DefaultPrinter = strReturn
End Function
You can now create a button and assign the PrintGreen macro to it and it
should print any emails you have selected to your specified printer. I did
test this on my computer and found there is a several second (ok like 10)
delay while printing. You may or may not have this issue. Anyway, post
back if you have any questions.
Paul D
: : > It's not possible at all in Outlook. If you want to format your
printout,
: > be selective in what's printed or print to a specific printer or use
: > background printing most of us use Word and take the data we want and
put
: > it into a Word template and then do the printing using the Word object
: > model.
:
: Many thanks for that, although I have to say I am very surprised and
: disappointed that VBA in Outlook is so limited. I gather you cannot even
set
: the active printer as in other Office applications.
:
: However, I haven't given up quite yet and wondered if anyone knows if
there
: are any third party applications that would help? For example, there used
to
: be a nifty freeware programme available that enabled one to automate
certain
: routine tasks but I can't remember it's details. Certainly changing the
: printer is not terribly complicated in terms of key strokes so I don't
know
: if this would be a possibility?
:
: Incidentally the reason I am trying to do this is to use Green Print with
: Outlook (only). Green Print can be downloaded from
www.printgreener.com
(the
: 'world' version is free) and it works between applications and one's
printer
: and enables one to easily stop blank or unimportant pages being printed.
So
: for Outlook it is ideal - and saves what you describe about having to copy
: and paste data to Word etc for controlled printing. However, for Word etc
it
: just slows things down (an unnecessary extra stage in the printing
process)
: and so I don't want it to be the default printer.
:
: V
:
: PS Suppose one way round this would be set Green Print as the default
: printer and then write macros for all the other Office programmes to set
: their active printers to the 'real' printer? A laboriously long way
round...
: