There is nothing wrong with renaming Inbox back to Inbox via code.
Something that has to be done in the older versions when something causes it
to get renamed. Other than that, I seem to remember a bug in earlier
versions where this would happen with calendar items, but for the life of
me, I can't remember the details.
Thank you for the response Neo.
I am using Outlook XP (2002). However, by going back through my versions of
code (Yes! I sometimes do "Save As" to a new version number each time I make
a code change) I have been able to find what I did wrong and have been able
to extract the incorrect code and use it to fix the my problem.
Everything now appears to be working as it should with the correct "Inbox"
name but I am still wondering if I have done anything that will cause
problems later. I am posting the code I used but feel free to condemn it if
you think that it can cause problems otherwise others on this forum could be
misled by it.
Sub RenameOutlookFolder()
'Used to rename the Inbox folder after accidently renaming it
'due to an error with Excel VBA code.
'Tested on Outlook XP (2002). Run from VBA in Excel XP (2002)
'but will probably work under VBA in other Office Applications.
'By using early binding (as per example) when dimensioning
'the variables the other GetDefaultFolder() parameters (for the
'other default folders) are displayed with the VBA intellisence
'when the opening parenthesis is typed.
'Note to use early binding:
'While in the VBA editor select Tools -> References
'and scroll down to Microsoft Outlook nn.0 Object Library
'where nn.0 is the version of Outlook (10.0 is XP or 2002)
'Ensure to check the box not just select the line.
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objFolder As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
objFolder.Name = "Inbox"
set objFolder = Nothing
set objNameSpace = Nothing
set objOutlook = Nothing
End Sub