Print email and, attachments sent in hyperlinks in the email

Status
Not open for further replies.

mediocrerecord

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Exchange Server
My question is a bit similar to this.
I receive emails daily about registrations from a certain email address. In this email there are 1-3 links.
The link text is "Download" and it refers to a link where the files are saved.
So if there is one attachment, it will say: some text: Download
For two it will say:
some text: Download
some text: Download
and for three:
some text: Download
some text: Download
some text: Download
What I am looking for as a vba macro is to be able to select these emails and then run the macro. The macro should print each email and then go to the link and print the attachments in these links one by one for all emails selected.
The order should be print email, print link 1 attachment, print link 2 attachment (if present), print link 3 attachment (if present), print second email, print second email attachments and so on.
I am looking for a vba solution as I won't have right to install anything else on the computer.
Appreciate your help.
I must mention here that I am completely new to outlook-vba and below has been generated by copy/paste/edit from here. It is working to print the emails. I now need help with printing the attachments by following the hyperlinks in the email. I have also come across this when doing more research, but it is all Greek to me.
Below is the code used to print the email.

Code:
Option Explicit



    Public Sub PrintDelete()

    Dim objOL                      As Outlook.Application

    Dim objMsg                     As Outlook.MailItem

    Dim objAttachments             As Outlook.Attachments

    Dim objSelection               As Outlook.Selection

    Dim i                          As Long

    Dim lngCount                   As Long

    Dim Response                   As Integer

    Dim msg                        As String

    Dim strSubject                 As String





     ' Instantiate an Outlook Application object.

    Set objOL = CreateObject("Outlook.Application")

     ' Get the collection of selected objects.

    Set objSelection = objOL.ActiveExplorer.Selection



     ' Check selected item for attachments.

    For i = objSelection.Count To 1 Step -1

               objSelection(i).PrintOut

               Call LaunchURL(objSelection(i).objMsg)

    Next



ExitSub:

    Set objAttachments = Nothing

    Set objMsg = Nothing

    Set objSelection = Nothing

    Set objOL = Nothing

End Sub
 

mediocrerecord

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Exchange Server
Hi. Thank you for your reply. Yes, there are two email addresses (showing as links) in the message as well.

I did come across this link but due to not having enough knowledge could not change it to print instead of save.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
K rule to print email pdf attachments upon arrival Using Outlook 1
5 Automatically print email attachments Using Outlook 7
Z Re: Auto Print email and word attachments on send Outlook VBA and Custom Forms 1
R Print email message and attachment in order Outlook VBA and Custom Forms 2
A Print first page of a new email Outlook VBA and Custom Forms 7
H Problems With Outlook 2013 VBA To Send and Print an email Outlook VBA and Custom Forms 1
H Formatting of email conversation print outs - URGENT Using Outlook 1
B Code for Email Page/Print Page BCM (Business Contact Manager) 1
I How can you print a selection of an email from MS Outlook 2010? Using Outlook 2
H Outlook 2007 Errors-Out/Restarts Trying to Print an Email with MS-Word Mark-Up Area Using Outlook 1
L how to print an email with default email account as header Using Outlook 1
B Previous printed email, printing on next email print job Using Outlook 4
D Unable to print email in outlook 2007 Using Outlook 2
R Images in email do not print correctly Using Outlook 2
C Can't print an email from MS Office Outlook 2003__ Using Outlook 2
M Custom Calendar Print Suggestions? Using Outlook 0
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
D Print Attachments only in selected emails using a macro Outlook VBA and Custom Forms 3
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
L Outlook 2002: HTML Emails Will Not Print: Please Help Using Outlook 0
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
S Macro to print & move selected emails? Using Outlook 3
J Auto print PDF attachments as they arrive with certain words in subject Outlook VBA and Custom Forms 3
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
Similar threads


















































Top