Solved

Macro to copy file attachment to c:  drive on incoming mail part 2

Posted on 2013-01-09
23
306 Views
Last Modified: 2013-01-17
0
Comment
Question by:route217
  • 14
  • 9
23 Comments
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
Well you tell me what would you require:
1) I can adapt it so it is run from outlook and not Excel and still do 1 file at a time like you highlight the file, press on a button this time in outlook and it will save it to disk.
2) Would you like when the button is pressed to process an entire folder ?? then this is what I need to know what option you want to ?

gowflow
0
 

Author Comment

by:route217
Comment Utility
Glow flow can you change the macro so - as the email arrive into outlook folder cm template folder the attachment automatically get copied to the c: drive and a copy of the email remains in read in outlook....
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
I see so you want to monitor the folder for incoming emails and then apply the macro. OK I need a snapshot of your outlook folders that show the CM template folder I need to see at what level is this folder can you open outlook and exapnd folders so I see clearly where is cm template in the personal or other folders and take a snapshot.
Press on you pc on Prt SC it is usually after F12 or somwhere there then open Paint and do CTRL V and save the file as .jpeg and attach it here.
gowflow
0
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
Comment Utility
I like to go one step at a time. Pls load this file it has now an additional button
'Save Attachements from selected folder' again, open outlook, select now a specific folder on the left pane not an email, and then click on this button and see the results. Let me know.
gowflow
saveattachments.xls
0
 

Author Comment

by:route217
Comment Utility
Thanks glow flow - let me test the file
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
did u had a chance to test the file ?
gowflow
0
 

Author Comment

by:route217
Comment Utility
apologies glow flow.....

testing tomorrow internet problems and computer problems too
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
ok no problem
gowflow
0
 

Author Comment

by:route217
Comment Utility
Glow flow

Two questions:-

1. My incoming email folder is called CMU Template which I gave changed the code to accommodate

2. How do I change the file path where the attachments are saved on c: drive?

And finally what do the two macro buttons do?
0
 

Author Comment

by:route217
Comment Utility
Getting a comple error user- defined type not defined

Public Sub SaveAttachment ()
Dim objOL as Outlook .Application
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
ok here are the answers:

=======================================
And finally what do the two macro buttons do?
=======================================
>>>>
Button: Save Email Attachments to documents on C
Let you save 1 single Email Attachment that is SELECTED in Outlook.

Button: Save Attachment from Selected Folder
Let you save 1 Entire Folder's Emails Attachment that is SELECTED in Outlook

In other words you open Outlook you select either 1 email that you wish to save its attachment or an entire folder (yellow folder on the left pane in outlook) and it will go thru all the emails and when it finds an Attachmnent it saves the attachment in the C folder specified in the macro. No specific Email or Folder name has been hardcoded in the macro you may choose any repeat any email or any folder Inbox, Sent Items CM Template XYZ Company any Folder that you like and press the button and it will go thru all the emails that exist in that folder and save them to disk !!!!

================================================================
2. How do I change the file path where the attachments are saved on c: drive?
================================================================
>>>>
All results of the macro are saved (like you requested in your Documents on C under folder OLAttachments. If you want this user set we can make the change or else you will need to change the code in both Subs SaveAttachments and SaveAttachmentsFmFolder at this line

strFolderpath = strFolderpath & "\OLAttachments"

Example if you wanted in C:\Test\Attachments then it will be
strFolderpath = "C:\Test\Attachments"

=============================================
Getting a comple error cannot find project or library...

Public Sub SaveAttachment ()
Dim objOL as Outlook .Application
=============================================
>>>>>
Load the file open goto VBA and on the Tolls Menu select References and in the list that is opened locate
Microsoft Outllook 12.0 or 14.0 Library and tick on it press ok close and save the workbook and start it again. You should not get an error.

Let me know results.
gowflow
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:route217
Comment Utility
Ok worked put error and what buttons do....
But I can find the saved attachment on the c: drive as an excel file ????
0
 

Author Comment

by:route217
Comment Utility
Excellent and apologies for being a pain...
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
great. Let me know here if you need to post a new question to refine this or change it I will be glad to assist. Pls post here a link to a new question u may need help with.
gowflow
0
 

Author Comment

by:route217
Comment Utility
Hello glow flow ...

How would amend the following question to show as a jpg as opposed to HTML output

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_27995923.html
0
 

Author Comment

by:route217
Comment Utility
Hi Glow flow

Any thoughts on the above question?

Regards
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
Well I looked it up but cannot run the code as dependant can't you post a workbook maybe as only the coould not too much helpful
gowflow
0
 

Author Comment

by:route217
Comment Utility
Hi Glow flow

The first code should work prefect fine.   It's the second code that has the availability to covert image to jpg... Not sure how to modify my hTMl section..

Unable to post workbook restrictions
0
 

Author Comment

by:route217
Comment Utility
Glow flow I am going to delete the questions as above link unless u are working on it - then apologies...

Need to look at a different approach to tackle this....
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
ok no problem I am not looking at it. Go ahead and delete it. I will keep this link open for you case u need assistance in an other question feel free to post a link here.
gowflow
0
 

Author Comment

by:route217
Comment Utility
0
 

Author Comment

by:route217
Comment Utility
Hi Glow Flow

This is the main question that is driving me round the bend...
Original code provided by the Guru Rorya

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_27998830.html

Explanation see question
0
 

Author Comment

by:route217
Comment Utility
Hi glow flow

Any feedback on these two question - how to tackle thm..
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now