+ Reply to Thread
Results 1 to 4 of 4

Moving Emails from Folder to Public Archive

  1. #1
    Registered User
    Join Date
    11-18-2015
    Location
    VA
    MS-Off Ver
    2016
    Posts
    19

    Moving Emails from Folder to Public Archive

    Currently, I have a macro that lets me place my selected email into my "Librarian" folder for filing to the public (shared) folder.

    Now, I'd like to have a macro that files all the emails in "Librarian" to their respective public folder.

    How do set the macro to iterate the emails in "Librarian", one by one, and move them to the right place?

    I've been able to accomplish this in excel, but outlook vba is slightly foreign.

    In psuedo-code:
    Please Login or Register  to view this content.
    Any help is appreciated, thanks

  2. #2
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Re: Moving Emails from Folder to Public Archive

    I assume you can get the folder and assign it to a variable.

    fldr.items will return a list of all the items in the folder (fldr is a variable that holds the folder you want to loop through).

    Be careful because mail items have different attributes than other items (meetings, etc). You can find out if it's a mail item using Typename(item) I believe mail item is MailItem but I'm not sure.

    Maybe there is a way to get only mail items directly but I don't know. I am very green when it comes to outlook. Just learning now. Came here looking for a way to display feedback to the user when mail items are being moved and came across your message.

  3. #3
    Registered User
    Join Date
    11-18-2015
    Location
    VA
    MS-Off Ver
    2016
    Posts
    19

    Re: Moving Emails from Folder to Public Archive

    So, I've figured out how to access public folders in outlook:

    Please Login or Register  to view this content.
    This will get me into the parent folder I need. Unfortunately, I need to access a subfolder within "olDestF", but I can't figure out how to get this to work.
    My code looks in the subject for a job number, if it's not there, it checks the body.
    Once it find the job number, it can get it to the correct Job "series folder".

    What I need is a wildcard for example, if a job is called "1234", it will have a job folder named "1234 - Treehouse Ave Remodel".
    I need a code that will find the job folder based on just the four digit job no.

    For example, in psuedo-code:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-18-2015
    Location
    VA
    MS-Off Ver
    2016
    Posts
    19

    Re: Moving Emails from Folder to Public Archive

    I just figured it out on my own, here's the code for reference if anyone needs it.
    Instead of error handling, if an email/item doesn't match then it's simply skipped, as per my needs.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Loop Through Folder, Create Emails with Sub Folder Names in Subject, Attach files in sub
    By Rschwar23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 10:06 AM
  2. Copy all emails in outlook folder and paste them in similar system folder and ms access
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2014, 07:31 AM
  3. Integrating Archive folders with duplicate emails
    By MARKSTRO in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 04-05-2013, 10:49 AM
  4. Cteate & Archive Outlook Folder
    By twitch73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-15-2012, 04:07 AM
  5. [SOLVED] Moving a row to archive sheet
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 10:43 AM
  6. Save attachements from Archive Folder
    By pr4t3ek in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2009, 07:35 AM
  7. Moving all but the newest files from one folder to an Archive folder.
    By Zaphius in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2007, 11:48 PM

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