Our company is using the Enterprise Vault system to store archived emails. 10% of the time I am able to retrieve my email. So I am making the switch to store them on my computer.
Here is what I am going to do:
- Count x number of emails in "archived" folder
- Open n email item in "archived" folder
- copy n email item
- move n email item to "computer" folder (note: the email must be open and moved.
- close n email window
- Repeat until n = x
I have a .pst folder on my computer.
Could someone help me develop the simplest code to accomplish step 2?
This is what I have so far...
Sub MoveToFolder()
Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olArcFolder As Outlook.MAPIFolder
Dim olCompFolder As Outlook.MAPIFolder
Dim mailboxNameString As String
Dim myInspectors As Outlook.MailItem
Dim myCopiedInspectors As Outlook.MailItem
Dim x As Integer
Dim iCount As Integer
mailboxNameString = "Emails Stored on Computer"
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olArcFolder = olNameSpace.Folders(mailboxNameString).Folders("Archived")
Set olCompFolder = olNameSpace.Folders(mailboxNameString).Folders("Computer")
'Make some kind of loop that counts the emails in the folder "Computer"
'opens it up, and then moves it to the folder "Archived"
Set myInspectors = Outlook.Application.ActiveInspector.CurrentItem
Set myCopiedInspectors = myInspectors.copy
myCopiedInspectors.Move (olCompFolder)
'next email
Well Guys, guess I'm teaching myself after all. This works for what i wanted.