Solved

How to copy the same Personal Folder structure in Outlook 2007

Posted on 2010-09-09
9
1,085 Views
Last Modified: 2012-05-10
I want to copy the same structure folders that I have no without the data. I am not trying to make a backup but just want to the folders. I have so much folders for me to go in one by one to delete the data (emails). Is there a funtion that can be used to clear the data?
0
Comment
Question by:justmiracle78
  • 4
  • 3
  • 2
9 Comments
 
LVL 6

Expert Comment

by:steverice
ID: 33641972
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33644635
Hi, justmiracle78.

If you'd like a more automated that eliminates all the manual steps in that article, then I can help.  I can provide a script that will create a new PST file and copy the structure from an existing PST file into it.  Please let me know if that's an acceptable solution and I'll post the code and instructions.
0
 

Author Comment

by:justmiracle78
ID: 33663256
Hi steverice, I actually found that before posting this questions but when I attempted those steps it was pretty long processs and didn't work.

BlueDevilFan, if you can write a script for it, that's be great! Please let me know.
Thanks
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33664856
Yes, I can script it.  I'll get the script written and posted as soon as I can (hopefully within the next 24 hours).
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 6

Expert Comment

by:steverice
ID: 33668323
Export the pst, archive all of the data out of it, import the pst....


I don't think it could be much simpler......
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 33678502
Here's the code for doing this.  Follow these instructions to use it.

1.  Start Outlook.
2.  Click Tools > Macro > Visual Basic Editor.
3.  If not already expanded, expand Modules and click on Module1.
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
5.  Click the diskette icon on the toolbar to save the changes.
6.  Close the VB Editor.
7.  Click Tools->Macro->Security.
8.  Change the Security Level setting to Medium.
9.  Select the folder you want to duplicate.
10. Run the macro.  The code does everything for you including creating the new PST file.
Dim olkSrcFolder As Outlook.MAPIFolder, _
    olkDestFolder As Outlook.MAPIFolder
 
Sub DuplicateFolderStructure()
    Dim strDestFolder As String
    Set olkSrcFolder = Application.ActiveExplorer.CurrentFolder
    strDestFolder = InputBox("Enter a name for the new Personal Folder.", "Duplicate Folder Structure")
    If strDestFolder <> "" Then
        Session.AddStore strDestFolder & ".pst"
        Set olkDestFolder = Session.Folders.GetLast()
        CreateFolder olkSrcFolder
    End If
    Set olkNewPST = Nothing
    Set olkDestFolder = Nothing
    Set olkSrcFolder = Nothing
    MsgBox "Completed.", vbOKOnly + vbInformation, "Duplicate Folder Structure"
End Sub
 
Sub CreateFolder(olkFolder As Outlook.MAPIFolder)
    Dim olkSubFolder As Outlook.MAPIFolder
    olkDestFolder.Folders.Add olkFolder.Name
    Set olkDestFolder = olkDestFolder.Folders.Item(olkFolder.Name)
    For Each olkSubFolder In olkFolder.Folders
        CreateFolder olkSubFolder
    Next
    Set olkDestFolder = olkDestFolder.Parent
    Set olkSubFolder = Nothing
End Sub

Open in new window

0
 

Author Comment

by:justmiracle78
ID: 33727622
Thank you BlueDevilFan!
0
 

Author Closing Comment

by:justmiracle78
ID: 33727627
Thanks!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33730002
You're welcome!  Glad I could help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

759 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

20 Experts available now in Live!

Get 1:1 Help Now