j.marton
(Janos Marton)
January 19, 2022, 4:33pm
1
Hi,
I want to build a strong GetOutlookMailMessages implementation. If the windows language changes, the Outlook Inbox folder name is changeing with that to. As you know, we have to specific the mail folder exact name to get emails from it. Is it possible for me as a developer, to get this information (i mean the Inbox folder current name) from somewhere? I am looking something like: Environment.Outlook.InboxFolder.Name.
Thanks in advance,
János!
Srini84
(Srinivas Kadamati)
January 19, 2022, 4:40pm
2
@j.marton
Check below link, It maybe the creation of the folder, but you can try to change according to your usecase
http://rpa-daddy.com/?p=370
Hope this may help you
Thanks
j.marton
(Janos Marton)
January 20, 2022, 12:24pm
3
Thanks, I looked at the link, but unfortunately it wasn’t helpful to me.
ppr
(Peter Preuss)
January 20, 2022, 1:15pm
4
have some researches in this direction:
oapp = new Microsoft.Office.Interop.Outlook.ApplicationClass()
oapp.GetNamespace(“MAPI”).GetDefaultFolder(OlDefaultFolders.olFolderInbox ).Name
1 Like
j.marton
(Janos Marton)
January 21, 2022, 3:02pm
5
Thanks, I researched in this direction, but found nothing useful.
I am facing with this compile error:
Error ERROR Validation Error Compiler error(s) encountered processing expression “New Microsoft.Office.Interop.Outlook.ApplicationClass()”.
Type ‘Microsoft.Office.Interop.Outlook.ApplicationClass’ is not defined. Main.xaml
I don’t know how could I define Microsoft.Office.Interop.Outlook.ApplicationClass
ppr
(Peter Preuss)
January 21, 2022, 3:09pm
6
with the code lines from above i was able to get the localized name (german) of the inbox folder
give try to add Microsoft.Office.Interop.Outlook to the namespace (import panel vlose to the variable panel)
1 Like
j.marton
(Janos Marton)
January 21, 2022, 4:53pm
7
Thank you very much, after all this I was able to create a working solution!
A possible solution in summarize:
You need to import this: Microsoft.Office.Interop.Outlook
Variables:
InboxName (String)
oApp (Microsoft.Office.Interop.Outlook.Application)
Activity:
Invoke code
Arguments:
Name: oInboxName Direction: Out Type: String Value: InboxName
Name: oApp Direction: In Type: Microsoft.Office.Interop.Outlook.Application Value: oApp
Code:
oApp = New Microsoft.Office.Interop.Outlook.ApplicationClass()
o_InboxName = oApp.GetNamespace(“MAPI”).GetDefaultFolder(OlDefaultFolders.olFolderInbox).Name
Language: VBNet
Then InboxName should be the name of the current inbox.
1 Like
ppr
(Peter Preuss)
January 21, 2022, 5:21pm
8
WE can do IT directly within assign activities as well
system
(system)
Closed
January 24, 2022, 5:21pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
j.marton
(Janos Marton)
January 27, 2022, 10:43am
11
I tried, but I got these 2 complie errors:
Error ERROR Validation Error Compiler error(s) encountered processing expression "New Microsoft.Office.Interop.Outlook.ApplicationClass()".
Option Strict On disallows implicit conversions from 'Microsoft.Office.Interop.Outlook.ApplicationClass' to 'Microsoft.Office.Interop.Outlook.Application'. Main.xaml
Error ERROR Validation Error Compiler error(s) encountered processing expression "oApp.GetNamespace(“MAPI”).GetDefaultFolder(OlDefaultFolders.olFolderInbox).Name".
'OlDefaultFolders' is ambiguous in the namespace 'Microsoft.Office.Interop.Outlook'. Main.xaml
I have Microsoft.Office.Interop.Outlook Import.
Any suggestion?
ppr
(Peter Preuss)
January 27, 2022, 10:53am
12
the conflict can be resolved when checking the XAML within a text editor /e.g. notepad++) and correct it if needed:
any references to UiPath.Mail and relates to this are to remove as it is creating the resolution issue
find starter help here:
GetRootFolderName.xaml (3.7 KB)