simple move to personal folder

V

vbaNEWBIE

Hello....newbie here. Hopefully this is quick and easy for someone to help
me with. I have looked all over and found some of what I need but cannot put
it all together. The main issue for me is the code to specify the folder I
want to move the emails to. Most samples seem to be using some variation of
the default Inbox and are not specifying a particular path to the folder.

I am hoping to use the code to learn how to create others by having a
template or format which to base it on. If I can get one to work I can
probably make others work :)

I would like code to move emails from the default Inbox to a personal folder
in a PST file. If the PST name must be included in the path then the
destination path for the folder is:
P:\PST\TestDataFile\TestDataFileNAME\TestDataFileNAMEfolder


The PST file is P:\PST\TestDataFile.pst
and I believe to get to the actual folder (TestDataFileNAMEfolder) you use
this path:
\TestDataFileNAME\TestDataFileNAMEfolder


I would like to create code to move email from the email address
(e-mail address removed) to the folder noted above. Eventually I would like it
to check for multiple emails and then move them to the correct corresponding
folders.

Also, is there a way to have the same sub to check for multiple different
email addresses and then move them to their corresponding folders ?

Thanks for any help or advice.

:)
 
S

Sue Mosher [MVP]

To get a non-default folder, you need to walk the folder hierarchy using the
Folders collections or use a function that does that for you. For examples,
see:

http://www.outlookcode.com/codedetail.aspx?id=628 - uses a folder path
string
http://www.outlookcode.com/codedetail.aspx?id=492 - searches for a folder by
name

The folder path is constructed of the names of the folders in the Folder
List navigation pane in Outlook, starting with the root folder for the data
store that holds the target folder. The .pst file name and path on the
computer drive are irrelevant (unless the .pst file is not already visible
in Outlook's Folder List).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top