Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

search and replace special characters in outlook folder names

Posted on 2013-11-04
1
Medium Priority
?
563 Views
Last Modified: 2013-11-14
Hi

I encourage my clients as much as I can to upgrade to online IMAP accounts

I often in the process have to transfer large quantities of data in the form of client emails
up to their new accounts

Forward slashes and periods wreak havoc during the transfer process, and slow everything down when one has to stop to analyze and determine what is still left to be uploaded

But some client folder structures are so immense that I could spend weeks sifting through them and still miss one of these troublesome characters.

Is there a way to automate the replacement of these characters throughout a PST or folder structure ? An Outlook macro maybe ?

any ideas ?

thanks

yann
0
Comment
Question by:Yann Shukor
[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
1 Comment
 
LVL 22

Accepted Solution

by:
rspahitz earned 1000 total points
ID: 39623466
You can try something like this:
Private Sub ShowAccountFolders()
    Dim pstFolders As Folders
    Dim objFolder As MAPIFolder
    Dim pstExplorers As Explorers
    Dim pstExplorer As Explorer
    Dim obj As Object
    Dim iExplorerCntr As Integer
    Dim iFolderCntr As Integer
    
    On Error Resume Next
    
    Set pstExplorers = Outlook.Application.Explorers
    For iExplorerCntr = 1 To pstExplorers.Count
        Set pstExplorer = pstExplorers.Item(iExplorerCntr)
        Set objFolder = pstExplorer.CurrentFolder
            
        Debug.Print objFolder.Name ', objFolder.Views.Count, objFolder.DefaultItemType
        Set pstFolders = objFolder.Folders
        ShowSubFolders pstFolders, 1
        Debug.Print
    Next
    
    Set pstExplorers = Nothing
End Sub

Private Sub ShowSubFolders(FolderObject As Folders, Level As Integer)
    Dim pstFolders As Folders
    Dim iFolderCntr As Integer
    Dim strIndent As String
    
    strIndent = String(Level, vbTab)
    For iFolderCntr = 1 To FolderObject.Count
        Debug.Print strIndent; FolderObject(iFolderCntr).Name
        
        If FolderObject(iFolderCntr).Folders.Count > 0 Then
            ShowSubFolders FolderObject(iFolderCntr).Folders, Level + 1
        End If
        
        FolderObject(iFolderCntr).Name = UpdateName(FolderObject(iFolderCntr).Name)
    Next
End Sub

Private Function UpdateName(StartingName As String) As String
    Dim strNewName As String
    
    strNewName = StartingName ' apply filtering of characters, etc.
    UpdateName = strNewName
End Function
    

Open in new window


You will need to:
1) Enable macros in Outlook
2) Click on the top-level folder ("Personal Folders")
3) Update the "UpdateName" routine to handle any of the adjustments you need, such as removing any apostrophes, replacing double-quotes with single quotes, etc.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

609 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