VBScript move Outlook Mail/post item from one public folder to another public folder folder

Posted on 2004-11-30
Last Modified: 2008-01-09
Hi All..

I need to move a post/mail item in a folder to another folder with VBScript on a customised form.  The form will have a button which will save/close the item and move it to a new lfolder..

Please can anyone assist?


Question by:Delboy
    LVL 1

    Accepted Solution

    If its strictly vbscript then this should do
        Set myOlApp = CreateObject("Outlook.Application")
        Set myNameSpace = myOlApp.GetNamespace("MAPI")
        'get a reference to the sent items folder
        Set mySentItems = myNameSpace.GetDefaultFolder(5)
        Item.Move mySentItems

    Author Comment

    It only worked!!!!  I am sure I did something similar, but it didn't work..

    Many thanks

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now