PDA

View Full Version : *Easily supportable* method of sorting attachments by sender



Asator
04-04-2011, 07:22 AM
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?

JP2112
04-04-2011, 01:33 PM
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.