Consulting

Results 1 to 2 of 2

Thread: *Easily supportable* method of sorting attachments by sender

  1. #1
    VBAX Newbie
    Joined
    Apr 2011
    Posts
    2
    Location

    *Easily supportable* method of sorting attachments by sender

    I have some code that allows a user to select multiple messages, then automatically save all attachments in those messages, and print them out. What they would like to do is be automatically be sorted to a specific folder based on the sender's domain name (its for an Accounts Payable rep).

    What would be the most easily supportable way of looking up the save-to folder? Obviously I could make a hard-coded two-dimensional array and do it that way, but I really don't want to have to crack open the code every time she needs to add or change something.

    Is there any way she could maintain a table with that information? Is there a way to call vlookup from outlook so she could keep it in a spreadsheet?

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    If the folder is based on the sender's domain, what do you need to look up? Just use the domain portion of the sender's email address and use the Dir function to look for the folder. If it doesn't exist, create it. You can then save the file into the folder.

    If you need to keep the data somewhere accessible to the end user, what I've done in the past is keep the data in a Note, then instruct the code to parse the note at runtime for the names and locations.
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

Posting Permissions

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