+ Reply to Thread
Results 1 to 15 of 15

Moving mail to Folders/Can't get to Slipstick

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Moving mail to Folders/Can't get to Slipstick

    I receive hundreds of emails every day that need to be moved to any of about 50 folders. However, Outlook's "Move to" list only lists 10 folders, which REALLY slows me down. Looking online, I see there's some macros that can help, but they're at Slipstick.com, which won't resolve on my computer at work. I'm familiar with Excel VBA, but out of my league on Outlook, so I'd really appreciate some help on this.

    But, to get things started, I have a macro I cobbled together years ago, which works, but it's not robust enough. I think it could work, but would be better with a userform listing all my possible folders, so I could check the one I want, and the userform could feed that to the macro and function below. No idea how to start on that, or if there's a better way.

    Please Login or Register  to view this content.
    Last edited by jomili; 12-09-2021 at 10:24 AM.
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

  2. #2
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    See if this helps.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    GWteB,
    That's a nifty one, allows me to browse to find the folder I want, but that really doesn't help much in my situation, since I have hundreds of folders nested multiple levels deep. Out of hundreds, there are probably less than 50 that are "use every day" folders, so I'd want to have a direct path on those, similar to my original macro above.

  4. #4
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    In that case a userform is more appropriate indeed.
    Insert a Userform1 in your VBA project and make sure it carries these controls: ComboBox1, Label1, CommandButton1 & CommandButton2
    Of course you are free to change the names of both userform and controls to meaningful names, this is even recommended, as long as you change the names in the code as well.
    The userform acts as a popup and is invoked using its GetOutLookFolderPathFromUser function.
    I'm sure it will give you an idea of the approach.
    Note that I've replaced the AT character in the code, otherwise my attempt to post was rejected since I'm a new member.

    This goes in the userform's module:
    Please Login or Register  to view this content.
    This goes in a standard module:
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    GWteB, I've got it all configured as you gave it. It's not throwing an error, but it's not moving the mail, either. I walked through the code (F8) a few times and spotted where, but not why. I noticed on the "GetAsOutlookFolder" function we traipsed through the "If not oFolder is Nothing" section 3 times for two selected emails, then jumped to the "GetAsOutlookFolder_Error" and exited the macro.

  6. #6
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    Quote Originally Posted by jomili View Post
    I noticed on the "GetAsOutlookFolder" function we traipsed through the "If not oFolder is Nothing" section 3 times for two selected emails, then jumped to the "GetAsOutlookFolder_Error" and exited the macro.
    This means the given folder doesn't exist, due to the lack of the third folder level. For example, given this folder name: \\JomiliATdfps.gov\PST_Migration\Personal Folders\1-Mine\1-Manual Coding\Pending
    The path "\\JomiliATdfps.gov" exists, also does the path "\\JomiliATdfps.gov\PST_Migration". Sub folder "Personal Folders" however couldn't be found, so the path "\\JomiliATdfps.gov\PST_Migration\Personal Folders" does not exist and the code branches out. So I think there's a typo on your end.

    I would also like to note the following. Prior to my previous post I didn't test your code extensively, now I did and immediately ran into a run-time error. This was caused by a random selection of items in a randomly sorted order. I therefore suggest to replace my previous posted MoveMail procedure with the one below.

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    So funny; I thought the same thing, and went through and traced each path to make sure it DID exist. I couldn't find anything, but clear as day today I see the error.
    Okay, so now I've proved your code, working to make the UserForm beautiful and get all my folder paths in place.
    Thanks so much for writing the code and showing me how.

  8. #8
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    You are welcome and thanks for letting me know
    If you believe this has resolved your issue, you may want to consider marking this thread as solved.

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    Almost, I have one related question, based on your original code: sometimes it would be nice to browse to something other than my preset folder list, so I'd want to use your browser code, but I'd like to be able to call it from within the same userform. So how would I call it from the userform, and then close out the userform once I've browsed to move my emails?

  10. #10
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    Of course I should have thought of that myself, so thanks for bringing that up. I will post shortly.

  11. #11
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    OK, so in addition to the code, the program sequence has also changed slightly. The GetAsOutlookFolder function is not invoked from the MoveMail procedure anymore, but from the userform.
    Obviously, the userform needs an extra button, so add a CommandButton3.
    Note that the name of the local variable Choise has been changed. With search and replace you can possibly change already existing references within the ComboBox1_Change event handler.
    In addition, a local variable has been added, in case Outlook's built-in folder explorer is used.

    This goes in the userform's module:
    Please Login or Register  to view this content.

    This goes in a standard module:
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    GTweB,
    thanks so much, it seems to be working well. The only other thing may be an issue I cause. The issue is that in both the last and this version there's a hesitancy before the action happens (more pronounced when moving multiple emails).

    In my original code I called "DeleteBoundedinSubject" which is a different macro (shown below) that I use to strip away stuff like "[MARKETING]" from a subject line of "[MARKETING] An Excel Addict Conundrum". The bounded text is added by my organization, and I have no way to turn it off.

    Not knowing where to put it in the new code, I slipped it into the macro as shown below. I'm not sure that's the optimum placement or if the two macros can be easily combined, but that's my next hurtle if you want to try your hand at it. :
    Please Login or Register  to view this content.
    Here's the code being called:
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    Quote Originally Posted by jomili View Post
    The issue is that in both the last and this version there's a hesitancy before the action happens (more pronounced when moving multiple emails).
    This behaviour is caused by a loop within a loop. The additional procedure is also looping through the collection of selected mail items, as well as the code by which this procedure is invoked.
    Best way would be to modify that additional procedure in a way it can act on a single mail item, that must be passed as an argument when the procedure is invoked. That would look like this:
    Please Login or Register  to view this content.
    Amend your current code like this:
    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,703

    Re: Moving mail to Folders/Can't get to Slipstick

    GWteb,
    I also seem to have resolved by the issue by not changing any of the code except the placement. Moving it to the front of the macro allows it to work on my full selection before the move action is invoked. But I WILL study your code closely to see if I can improve my original "DeleteBoundedinSubject" macro. Thanks so much for all your help.
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Moving mail to Folders/Can't get to Slipstick

    Glad to help and thanks for the follow-up.

+ 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. Sort Mail to Outlook Public Folders
    By benjamin86 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2019, 05:30 PM
  2. [SOLVED] moving folders to one
    By aminexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2015, 01:13 PM
  3. Not cool, e-mail folders.
    By Lennnny in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 12-17-2013, 04:56 PM
  4. Simple Macro: Delete mail in certain folders
    By Student1990 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2013, 04:49 PM
  5. Need to search & Open a mail from Outlook folders
    By u767 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 05:44 AM
  6. Will moving folders mess up formula?
    By welshman010 in forum Excel General
    Replies: 6
    Last Post: 09-06-2008, 08:04 PM
  7. Moving workbooks between folders
    By Ozzie in forum Excel General
    Replies: 3
    Last Post: 01-25-2006, 05:30 AM

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