View Single Post
 
Old 03-25-2021, 07:00 AM
maxscott maxscott is offline Windows 10 Office 2019
Novice
 
Join Date: Mar 2021
Posts: 2
maxscott is on a distinguished road
Default Namespace Folder Name Changed

I have been writing some VBA to file my emails. Something strange has happened though with my namespace folders.
I had 2 accounts - one abc@abc.co.uk and xyz@xyz.co.uk. Each has a folder under my application referenced with this code...

Dim olapp As Object
Dim olNS As Object
Dim oFolder As Object

Set olapp = CreateObject("outlook.application")
Set olNS = olapp.GetNamespace("MAPI")

I could then reference each with set ofolder=olNS.folders("abc@abcdef.co.uk") for instance. With older I then had olfolder.folders("Inbox") etc.

Both the primary accounts appeared in my outlook window named abc@abc.co.uk and xyz@xyz.co.uk respectively.

I then have some code which references folders and emails below these inboxes. But now the references have changed to olns.folders("inbox").folders("inbox") and the names in my outlook window are both shown as Inbox.

I don't see how I can have changed these but what is worse i can't change them back. If I try olns.folders(1).name="abc@abc.co.uk" system wonlt accept anything after the "@" and thus ? olns.folders(1).name just gives "abc".

Is there something specifically different about namespace folders?

Many thanks
Reply With Quote