+ Reply to Thread
Results 1 to 7 of 7

Email/Attachments Copy and Register through Excel Macro

  1. #1
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Email/Attachments Copy and Register through Excel Macro

    Hi,

    I would like to automatize email register, I'd appreciate if someone can Help me.

    I would mark as Red Cathegory some emails in Outlook 2013.
    Then from a file in ‘D:\user\mail\in’ (see attached) I want to actívate a macro and:

    1. Save a copy of those emails in ‘D:\user\mail\in\emails’ with name: Received - Subject (yymmdd_hhmm - Subject.msg)

    2. If email has attachments, sabe attachments in ‘D:\user\mail\in\attachments\aammdd_hhmm_#’ (the # is in case i got multiple emails from same minute)(I am aware this way I am duplicating these files which are in email copy, and on their own (plus in Outlook)).

    3. in Excel File, it completes list with the emails and attachments that have been copied, and creating hypervincles to them.

    4. Once this is done, it changes email cathegory to Green.

    All of these files will be in a server, so multiple users will need to be able to use this file, not sure if this changes anything.

    Thanks a lot for your Help!!!
    I
    Attached Files Attached Files
    Last edited by SAI80; 07-07-2020 at 06:14 AM.

  2. #2
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Re: Email/Attachments Copy and Register through Excel Macro

    Thanks in advance!
    Last edited by SAI80; 07-07-2020 at 06:15 AM.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Email/Attachments Copy and Register through Excel Macro

    Hi SAI80,

    Try the attached file that contains the following code. I added items to the 'Comments' column for additional visibility. There are several items at the top of Ordinary Code module ModOutlookFindEmail in red that can be changed if you change your design requirements.


    Please let me know if you have any questions or need any additional assistance.

    Please Login or Register  to view this content.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    Lewis

    July 21, 2020 - Attachment deleted by poster due to runtime error when Subject contains a colon ':' character. See the file associated with post #7 in this thread for a corrected attachment.
    Last edited by LJMetzger; 07-21-2020 at 09:20 AM. Reason: Deleted attachment due to runtime error

  4. #4
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Re: Email/Attachments Copy and Register through Excel Macro

    Thanks a lot!!
    It looks great! I need a bit of time to understand exactly what you are doing and I will definetly try it on Monday and give you Rep. points!

    I had solved it with one Sript in Outlook activated by a Rule that saves the emails and then a separate Excel that creates the list.
    I'll post them as well.

    I.

  5. #5
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Re: Email/Attachments Copy and Register through Excel Macro

    Thanks it Works fine.
    Only bit does not work is when subject is 'RE: subject' then it saves 'yymmdd_hhmm RE'
    Rest is really fantastic.
    I.

  6. #6
    Registered User
    Join Date
    01-23-2020
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    22

    Re: Email/Attachments Copy and Register through Excel Macro

    I had solved with Outlook rule that activates following script (saves emails and attachments in specified folder)

    Don't know what happens if i try to copy code it does not let me..
    nevermind.

    I

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Email/Attachments Copy and Register through Excel Macro

    Hi,
    Only bit does not work is when subject is 'RE: subject'
    Sorry for the problem you were having. See the attached file that fixes the problem. You encountered the problem because ':' (colon) is an illegal character in a File Name. I removed the character from file names. There are other illegal characters I did not bother to test for.

    The modified code excerpt looks like:
    Please Login or Register  to view this content.
    Thanks for the rep points.

    Please let me know if you have any more problems.

    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro for Email attachments from excel list fails when first line is " "
    By jgriffi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2019, 03:23 PM
  2. copy data from outlook email attachments to a local file
    By s_samira_21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2014, 10:24 AM
  3. Copy Outlook email attachments to Local drive(specified Path)
    By Nanimadhu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2014, 08:26 AM
  4. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  5. [SOLVED] Excel Macro to download email attachments from MS Outlook.
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2010, 02:10 PM
  6. adding multiple attachments to a macro in excel for a email using outlook
    By ccbltdneedhelp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2009, 11:03 AM
  7. email several attachments (change to ron's macro?)
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2005, 11:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1