Print Macro with Page Range?

Status
Not open for further replies.
I would like to write a very simple macro to print only the first page of an email. It would seem to me that I could just insert something like:

obj.PrintOut From:=1, To:=1, Copies:=1 (Taken From Excell Macro)

OR

obj.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _

wdPrintDocumentContent, Copies:=1, Pages:="1", PageType:=wdPrintAllPages, _

ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _

False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _

PrintZoomPaperHeight:=0 (Taken From Word Macro)

into the OTM macro below, I have tried both with minimal tweaking and have had no success. As it is now possible to do File>Print>Print Range it seems that a macro could be written to preform this function. Assistnace with the proper code would be awesome.

If this is not possible, is there a way to work around this? For example a macro that would make a plain text copy, print one page, then delete the plain text copy. Maybe something that would open it in a browser print one page and then close it. Again, any help would be awesome!

Public Sub PrintMail()

Dim obj As Object

Set obj = Application.ActiveExplorer.Selection(1)

obj.Display

obj.PrintOut

End Sub
 

Forum Admin

Senior Member
BTW, one Outlook developer MVP suggested sendkeys - not elegant, but can get the job done.

Code:
Sub PrintOnePage()
   SendKeys "%F", False
   SendKeys "P"
   SendKeys "{TAB 2}", True
   SendKeys "{DOWN}", True
   SendKeys "1"
   SendKeys "{ENTER}" 
 
End Sub
(Those are the send keys for 2007.)
 

manitou13

Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Slipstick & Detr0itkid,

Good info thus far in this thread. I have a question for you two.

Essentially, I would like to have one specific folder (for example, "print_folder") in my tree to automatically print the first page on any e-mail messages in this folder that is a new message. I already have a rule set where specific e-mail messages are directed to the print_folder. But I would like to see all new mail that is dropped in print_folder automatically the first page is printed in each message.

Any thoughts?

Thanks!

-Eric
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
if you want to print it as you move the mail, try a rule that runs a script (the link to the macro Detr0itkid posted) then moves the mail. Because its a full macro and not a script, you might need to call it with a script. I'm not sure if the delay Det0itkid mentions will affect the ability of the rule to work correctly. (I have not tested it.)
 

manitou13

Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Diane,

It would be awesome since the mail is automatically moved to a specific folder (print_folder) that it also will automatically print the first page once the mail arrives to the folder...

Thanks! :)

-Eric
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I hven't tested that macro with a rule, but it might work.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
D Print Attachments only in selected emails using a macro Outlook VBA and Custom Forms 3
S Macro to print & move selected emails? Using Outlook 3
P Possible to write a macro to print all attachments with specific . Outlook VBA and Custom Forms 1
M Custom Calendar Print Suggestions? Using Outlook 0
M Print email and, attachments sent in hyperlinks in the email Outlook VBA and Custom Forms 2
D Print attachments automatically and moves the mail to a new folder Outlook VBA and Custom Forms 9
A Day view - print appointment details Calendar Printing Assistant 1
I print calendar without subject and details Using Outlook 1
oliv- property "is printed" or catching print events Outlook VBA and Custom Forms 2
I Print Automatically Attachments Outlook VBA and Custom Forms 3
Diane Poremsky Print a list of your Outlook folders New Slipstick.com Articles 0
Diane Poremsky Combine and Print Multiple Outlook Calendars New Slipstick.com Articles 0
B Print list of previously sent recipients Using Outlook 1
R Print email message and attachment in order Outlook VBA and Custom Forms 2
L Outlook 2002: HTML Emails Will Not Print: Please Help Using Outlook 0
A Print first page of a new email Outlook VBA and Custom Forms 7
Diane Poremsky Print Monthly or Work Week Calendars New Slipstick.com Articles 0
Diane Poremsky No drop down calendars in Outlook 2010 Print Options New Slipstick.com Articles 0
Diane Poremsky Print Monthly or Work Week Calendars New Slipstick.com Articles 0
J Auto print PDF attachments as they arrive with certain words in subject Outlook VBA and Custom Forms 3
H Problems With Outlook 2013 VBA To Send and Print an email Outlook VBA and Custom Forms 1
D Outlook 2013 Categories won't print In color Using Outlook 2
G Calendar monthly view - Print just 3 weeks Calendar Printing Assistant 5
R Can't modify Outlook view font with IE anymore (even though IE still affects print font) Using Outlook 5
M Print Attachments from another mailbox (not default) Outlook VBA and Custom Forms 2
E Outlook VBA to print attached Pdf to a fax printer and assign fax number Using Outlook 0
L Outlook 2010 Quick Print Attachment, nothing happend Using Outlook 0
C automatically print attachments Using Outlook 4
J Automatically Print PDF When They Are Received Using Outlook 4
M button to send and print emails Using Outlook 26
S How to print ONLY first line of appointments in month view? Using Outlook 1
M print free/busy schedule of an user Using Outlook 2
O For Outlook 2007 - VBA to print attachments Using Outlook 1
W Cannot print Outlook 2007 emails Using Outlook 2
R problem with incomming e-mail I am unable to print full e-mail letter Using Outlook 1
M Custom print contacts Using Outlook 2
E Can't print from Outlook on wifi network Using Outlook 0
E can't print some retail discount coupons Using Outlook 7
J calendar print setup in outlook 2010 Calendar Printing Assistant 1
J Outlook 2010 using Quick Print to print attachments Using Outlook 1
D Use Outlook 2003 embedded imaged cannot print from the mail preview list Using Outlook 4
J Print next 7 days view of calendar (2010) Using Outlook 3
C Print all emails in a single folder with sent items Using Outlook 2
P Outlook closes down after clicking on the quick print icon. Using Outlook 3
I Outlook 2010 Print Created Date on Drafts Using Outlook 3
P Print multiple pocket calendars on one page Using Outlook 5
P Mail Merge vs Direct Mail Print BCM (Business Contact Manager) 4
A Print / View / Contacts Using Outlook 1
H Formatting of email conversation print outs - URGENT Using Outlook 1
A Outlook 11 for Mac won't print e-mail attachments Using Outlook 6
Similar threads


















































Top