how to refresh folder names in OL2002

G

Graham Charles

I've written VB code to rename my archive folders (since Outlook renames
them all to "Archive Folders" during an archive --- see
http://support.microsoft.com/?id=218470 if you're interested). This works
just fine, except the folder list doesn't get refreshed, so the application
has to be closed and re-opened for me to be able to see the update. Can
anyone point me to a way to force the folder names to refresh?

Thanks,

g.

Here's the proc:

Public Sub RenameArchiveFolders()

Dim myNamespace As NameSpace
Dim myFolder As MAPIFolder

Set myNamespace = Application.GetNamespace("MAPI")

' / enumerate archive folders
On Error Resume Next ' ignore those with missing descriptions
For Each myFolder In myNamespace.Folders
If myFolder.Name = "Archive Folders" Then
If Len(myFolder.Description & "") > 0 Then
If Err.Number = 0 Then
myFolder.Name = myFolder.Description
End If
End If
End If
Err.Clear
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top