?
Solved

How to copy the same Personal Folder structure in Outlook 2007

Posted on 2010-09-09
9
Medium Priority
?
1,101 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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 article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
Suggested Courses

771 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