So I've been playing with VB for a while and now I have an issue in Outlook. I have to send multiple invoices, that are PDF's, to multiple customers. The code below will change the subject line to the file name and make sure that the customer knows where the email is coming from. I want to be able to print the attachments twice. At the moment I quick print them, which isn't too hard but its an extra mouse movement I don't want to do. I have tried creating a separate routine that saves the attachment to the harddrive and prints from there, but I've had limited success. Is there an easy way to achieve what I want? Thanks in advance.
Sub Inv()
Dim yMailItem As MailItem
Dim yAttachment As Attachment
Dim yFileName As String
Dim yInspector As Outlook.Inspector
On Error Resume Next
Set yMailItem = Outlook.ActiveInspector.CurrentItem
If yMailItem.Attachments.Count = 0 Then
Exit Sub
End If
yFileName = ""
For Each yAttachment In yMailItem.Attachments
If yFileName = "" Then
yFileName = yAttachment.FileName & " "
Else
yFileName = yFileName & yAttachment.FileName & " "
End If
Next yAttachment
yMailItem.subject = "Invoice from JOE Bloggs Inc... " & yFileName
yMailItem.subject = Replace(yMailItem.subject, " image001.png ", " ")
Set yMailItem = Nothing
End Sub