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