Why not use the AutoArchive feature and have Outlook create a PST file
on your local drive? Or ask IT to increase your limit?
If you want a VBA solution, you need to set an object reference to the
message you want to move, and the folder you want to move it to. For
example, this code will move a selected or open mail item to a folder
called "Archive", one level below the Inbox (if you don't have that
folder, you would need to create it). Adjust reference as necessary.
Sub MoveEmail()
Dim myItem As Outlook.MailItem
Dim MyFolder As Outlook.MAPIFolder
Dim olNS as Namespace
' get valid ref to current item
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set myItem = ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set myItem = ActiveInspector.CurrentItem
Case Else
End Select
On Error GoTo 0
If myItem Is Nothing Then
MsgBox "Could not use current item. Please select or open a
single email.", vbInformation
Exit Sub
End If
Set olNS = Application.GetNamespace("MAPI")
Set MyFolder = olNS.GetDefaultFolder(olFolderInbox).Folders("Archive")
myitem.Move MyFolder
End Sub
You will have to point MyFolder to the correct folder. See
http://www.codeforexcelandoutlook.com/ResendMsg.html if you want to
assign this code to a toolbar button for easy access.
HTH,
JP
> Hi,
> I need a bit of help please.
[quoted text clipped - 18 lines]
>
> Regards, Emil
Emil - 11 May 2008 00:37 GMT
Hi JO,
Thanks for your quick answer.
The Auto-Archive function is good, but it does not entirely answer my need
(it only lets me choose the PST file for the auto archive and it will
replicate the inbox folder tree). I need to be able to choose the source
folder (from the inbox) and the destination folder (which usualy is an
already created folder with a totally different name and path in my PST)
Thanks for the macro. It is good, all tough I will need a slight change in
it. I do not need to move items that I select from INBOX. I need to move the
contents of each one of my 20 folders from under my INBOX to some specific
paths in my PST (ex: The contents of the folder MAILBOX/INBOX/Email
concerning John will go in PST PersonalFolders/Employees/John Malcom/Emails
concerning John)
I need it in this way as I file my emails (in my Inbox Folders)when I
receive them in on my BlackBerry (which can only access the Exchange Server)
and I want to avoid 20 copy/pastes from the inbox folders to their
corespondents in my PST.
Also, as I work in a customer service enviroment and I change employees
often, I would need to be able to change the source and the target folders
easily in the macro (I am all new to this type of usage).
I would prefer a simple macro (that does only this funtion for one email
transfer) and I will multiply it myself for the number of the folders I need.
I can more easily work with it as when an employees leaves I only have to
remove his specific macro without touching to the others.
I really appreciate your help.
I hope that what I need is not too complicated to program :)
Thanks in advance
rcd - 15 Jun 2008 18:23 GMT
A more specific question is how to I move ALL emails from the INBOX to
another folder or PST? I set up a rule, the move all emails addressed to me,
to antoehr pst. That sounds correct, expect when implemented, it will not
move emails sent to me if I'm part of a group.
this is goofy. Where is the move *.* commmand?
rcd
> Hi JO,
>
[quoted text clipped - 33 lines]
>
> Thanks in advance
JP - 17 Jun 2008 03:23 GMT
If you want to move every email that comes into your Inbox, then it
doesn't matter who it is sent to, the fact that it is in your Inbox
means it was sent to you. That is what VBA will do for you.
If you want to move all incoming emails to another folder, this code
should work as a starting point.
http://tinyurl.com/6gun7q
HTH,
JP
> A more specific question is how to I move ALL emails from the INBOX to
> another folder or PST? I set up a rule, the move all emails addressed to me,
[quoted text clipped - 4 lines]
>
> rcd