Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2016, 06:15 PM
charlesdh charlesdh is offline Error Saving Outlook attachment Via Excel code Windows 7 32bit Error Saving Outlook attachment Via Excel code Office 2010 32bit
Expert
Error Saving Outlook attachment Via Excel code
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default 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

Attached Files
File Type: xlsm TestOutlookCode.xlsm (14.2 KB, 8 views)
Reply With Quote
  #2  
Old 01-04-2016, 11:55 AM
charlesdh charlesdh is offline Error Saving Outlook attachment Via Excel code Windows 7 32bit Error Saving Outlook attachment Via Excel code Office 2010 32bit
Expert
Error Saving Outlook attachment Via Excel code
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Saving Outlook attachment Via Excel code 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
Error Saving Outlook attachment Via Excel code VBL code for automatic attachment of file into email DrLoveday1 Outlook 1 04-12-2013 05:36 AM
Error Saving Outlook attachment Via Excel code 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft