Solved

How to copy the same Personal Folder structure in Outlook 2007

Posted on 2010-09-09
9
1,096 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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