Solved

How to copy the same Personal Folder structure in Outlook 2007

Posted on 2010-09-09
9
1,087 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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
 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

832 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