MobileMobile | Continue

Excel Bar

Excel Bar

Your excel questions will be responsed by our excel experts within 24hrs.Our service is free.

 Forgot Pass?
 Register Now
Find
Hot Search: Vlookup Match VBA
View: 322|Reply: 4

Any way to print attachments from multiple emails as they arrive?

[Copy link]

1

Topics

3

Posts

17

Integral

Member

Rank: 2

Integral
17
Post on 9-30-2016 09:05:49 | All posts |Read mode
Hi,
I have a situation where one email address receives about 120-150 emails every Monday.
Each email has a PDF attachment. I want this attachment printed (Please note: I want the attachments printed and not the email. Default printer is fine).
So far I have tried several online resources to get this done. I have had some success with this script.
Sub LSPrint(Item As Outlook.MailItem)
On Error GoTo OError
'detect Temp
Dim oFS As FileSystemObject
Dim sTempFolder As String
Set oFS = New FileSystemObject
'Temporary Folder Path
sTempFolder = oFS.GetSpecialFolder(TemporaryFolder)
'creates a special temp folder
cTmpFld = sTempFolder  \OETMP  Format(Now, yyyymmddhhmmss)
MkDir (cTmpFld)
'save  print
Dim oAtt As Attachment
For Each oAtt In Item.Attachments
FileName = oAtt.FileName
FullFile = cTmpFld  \  FileName
'save attachment
oAtt.SaveAsFile (FullFile)
'prints attachment
Set objShell = CreateObject(Shell.Application)
Set objFolder = objShell.NameSpace(0)
Set objFolderItem = objFolder.ParseName(FullFile)
objFolderItem.InvokeVerbEx (print)
Next oAtt
'Cleanup
If Not oFS Is Nothing Then Set oFS = Nothing
If Not objFolder Is Nothing Then Set objFolder = Nothing
If Not objFolderItem Is Nothing Then Set objFolderItem = Nothing
If Not objShell Is Nothing Then Set objShell = Nothing
OError:
If Err  0 Then
MsgBox Err.Number   -   Err.Description
Err.Clear
End If
Exit Sub
End SubWhen i try running a script on new email arriving, I can print the attachments fine when it is 10-15 emails at once.
But when, as I mentioned, working with 100+ emails,  I keep getting 75 file/path access error.
I had this in my ThisOutlookSession and setup a rule on all incoming emails to run a script.
Any help with this is greatly appreciated.
Thanks,
Carna






Last edited by carna; 07-25-2016 at 08:36 AM.









Reply

Props Report

0

Topics

1

Posts

4

Integral

Newbie

Rank: 1

Integral
4
Post on 9-30-2016 09:42:51 | All posts



Hi Carna,
You are able to set a rule to print incoming attachments without the use of code for specific email addresses....?




Reply Support Opposition

Props Report

1

Topics

3

Posts

17

Integral

Member

Rank: 2

Integral
17
 Author| Post on 9-30-2016 10:07:22 | All posts



I don't think so. Currently on Outlook 2013 (2010 and 16 as far as i know) has a rule which lets you select emails with attachments and print. But this prints the email and not the attachment. I want the attachments printed. Not the email.
Reply Support Opposition

Props Report

1

Topics

3

Posts

17

Integral

Member

Rank: 2

Integral
17
 Author| Post on 11-10-2016 13:31:21 | All posts



I don't think so. Currently on Outlook 2013 (2010 and 16 as far as i know) has a rule which lets you select emails with attachments and print. But this prints the email and not the attachment. I want the attachments printed. Not the email.




Reply Support Opposition

Props Report

2

Topics

5

Posts

18

Integral

Member

Rank: 2

Integral
18
Post on 11-10-2016 14:05:02 | All posts



Is there a way to do this for only one specific email address?
Reply Support Opposition

Props Report

Points policy of this forum

Archiver|Mobile|Small dark house|Contact us|Excel Bar

GMT-5, 11-18-2017 14:18 , Processed in 0.277223 second(s), 20 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

!fastreply! Top !return_list!