Solved

How to copy the same Personal Folder structure in Outlook 2007

Posted on 2010-09-09
9
1,092 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

733 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