#1
|
|||
|
|||
Error Saving Outlook attachment Via Excel code
HI,
Hate to say this but, I have a problem that I can not resolve. In this part of the code is where I get a error for permission. It worked on Saturday. But, when I went back to it today(Sunday) to test before I moved it to my actual project it failed me. Code:
If oOlItm.Attachments.Count <> 0 Then For Each oOlAtch In oOlItm.Attachments '~~> Download the attachment oOlAtch.SaveAsFile NewFileName & oOlAtch.Filename''Failes here Exit For Next Else MsgBox "The First item doesn't have an attachment" End If |
#2
|
|||
|
|||
Hi,
The problem was a error on my part. The file that is working for me is not the one I posted here. The line of code I posted was incorrect. Her's what this part of the could should have been. Code:
If oOlItm.Attachments.Count <> 0 Then For Each oOlAtch In oOlItm.Attachments '~~> Download the attachment oOlAtch.SaveAsFile oOlAtch.Filename''Corrected to this Exit For Next Else MsgBox "The First item doesn't have an attachment" End If |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error in VBA code | ozman86 | Excel Programming | 3 | 11-27-2014 01:06 PM |
error code 30029-4 | zignaasa | Office | 0 | 05-24-2014 10:07 PM |
VBL code for automatic attachment of file into email | DrLoveday1 | Outlook | 1 | 04-12-2013 05:36 AM |
error saving word doc with bibliography | shmoib | Word | 1 | 07-03-2011 02:32 AM |
Error code 0x800CCC80 | Kevin | Outlook | 1 | 03-18-2011 07:20 AM |