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
 
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.
Similar threads
Thread starter Title Forum Replies Date
G Print email attachments when hit subfolder Outlook VBA and Custom Forms 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
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
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
U Outlook not responding when trying to print Emails Using Outlook 6
S Cannot print Contacts Using Outlook 7
G print attachment straight away; working script edit not working Outlook VBA and Custom Forms 0
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
S CONTACT FIELD PRINT ORDER Outlook VBA and Custom Forms 1
B Outlook 2016 Outlook crashes when trying to print certain emails Using Outlook 5
M Batch print without appended trail of repeated e Using Outlook 2
Witzker print-list-of-outlook-folders with sort posibility Outlook VBA and Custom Forms 7
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 Using Outlook 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 Using Outlook 0
Diane Poremsky Combine and Print Multiple Outlook Calendars Using Outlook 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 Using Outlook 0
Diane Poremsky No drop down calendars in Outlook 2010 Print Options Using Outlook 0
Diane Poremsky Print Monthly or Work Week Calendars Using Outlook 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 Using Outlook 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

Similar threads

Back
Top