Add folder to second Outlook account instead of default account

Hi
I have issue to create new sub folder in outlook ,
I have two account and i want to add folder second Account .
my code:
oapp.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox).Folders.Add(“ABCS”,Type.Missing)
but it create folder in first or default account.
Any Hepl how to add folder to seccond account instead of default account?

Thanks

Thanks

Hi @afsaneh_keivani ,

Could you Check with the Below Expression :

oapp.Session.Folders[1].Folders.Add("ABCS",Type.Missing);

Here the Index 1 is used to access the Second Account in Outlook.

1 Like

Thanks it worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.