Forum Discussion
API / link for a list of Outlook/OWA/Office default folder names/strings
- Mar 09, 2021
Thank you for your help. I've created the following class which I believe could and should be added to the official API.
using System; using System.Collections.Generic; using System.Reflection; using Oulook = Microsoft.Office.Interop.Outlook; namespace OutlookDefualtFolderNames { public static class OutlookToolsHMS { private const string k_MapiNamespaceStr = "mapi"; private static Oulook.NameSpace GetOutlookNameSpace() { Oulook.Application oApp; Oulook.NameSpace oNS; // Create the Outlook application. // in-line initialization oApp = new Oulook.Application(); // Get the MAPI namespace. oNS = oApp.GetNamespace(k_MapiNamespaceStr); // Log on by using the default profile or existing session (no dialog box). oNS.Logon(Missing.Value, Missing.Value, false, true); // Alternate logon method that uses a specific profile name. // TODO: If you use this logon method, specify the correct profile name // and comment the previous Logon line. //oNS.Logon("profilename",Missing.Value,false,true); return oNS; } public static List<string> GetAllDefualtTranslatedFolderNames() { List<string> folderNames = new List<string>(); Oulook.NameSpace oNS = GetOutlookNameSpace(); foreach (var folder in Enum.GetValues(typeof(Oulook.OlDefaultFolders))) { try { folderNames.Add(oNS.GetDefaultFolder((Oulook.OlDefaultFolders)folder).Name); } catch { } } return folderNames; } public static List<string> GetDefualtTranslatedFolderName(string name) { List<string> folderNames = new List<string>(); Oulook.NameSpace oNS = GetOutlookNameSpace(); string folderName; foreach (var folder in Enum.GetValues(typeof(Oulook.OlDefaultFolders))) { try { if (folder.ToString().ToLower().Contains(name.ToLower())) { folderName = oNS.GetDefaultFolder((Oulook.OlDefaultFolders)folder).Name; folderNames.Add(folderName); } } catch { } } return folderNames; } } }
I apologize for the misunderstanding.
I need the real folder name. Therefore, I'm asking for a list of the default translation folder names or an API which could provide a default translated folder name by language, which should be something like:
getLocalizedFolderName("Inbox", "Hebrew")
or
Microsoft.Exchange.WebServices.Data.WellKnownFolderName.Inbox.getLocalizedNameFor("Hebrew")
https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-work-with-folders-by-using-ews-in-exchange ?
- sagiselaMar 07, 2021Copper ContributorYes, but since I'm developing an RPA process using UiPath and using UiPath Email tools for the development, which use the folder name as a filter and can't use the folder id, I haven't found them useful.
- Victor_IvanidzeMar 07, 2021Bronze ContributorAnd did you asking for help the UIPath support?
- sagiselaMar 08, 2021Copper Contributor
I haven't asked for help the UIPath support because I believe Microsoft should offer a solution. That's certainly not the kind of information Microsoft should avoid sharing.
Moreover, I'm sure Microsoft wants us (developers) to be happy and feel comfortable in order to encourage us to keep developing more tools and features for/using Microsoft programs and platforms.