TC12, Outlook16 - select folder does not work
Need to set current selected folder in Outlook 16 (and 13).
The folder is a subfolder of Inbox.
With TC11 I could do it the following way (JScript😞
var folder = 'TestFolder';
var folderObj = outlook.GetNamespace('MAPI').Folders(EMAIL).Folders(INBOX_FOLDER).Folders(folder); outlook.ActiveExplorer.CurrentFolder = folderObj;
In TC12 it doesn't work.
const folderObj = outlook.GetNamespace('MAPI').DefaultStore.GetRootFolder().Folders.Item(EMAIL).Folders.Item(folder); const ex = outlook.ActiveExplorer(); ex.CurrentFolder = folderObj;
Variables valuse after first 2 lines, before the third:
After executing the third line an error occures:
Reproduces on both Outlook 16 and 13.
win10 x64, Office 32-bit
Please help in resolving the matter.
Solved! Go to Solution.
I suggest you contact Support directly about this issue. Here's the link:
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
Contacted the support 4 days ago, waiting for the response.
Will write the answer below if any.
We've figured out ourselves how to implement that in TC12.
outlook.GetNamespace('MAPI').DefaultStore.GetRootFolder().Folders.Item(folder); outlook.Application.ActiveExplorer().SelectFolder(folder); const currentView = outlook.Application.ActiveExplorer().CurrentFolder.CurrentView; currentView.Reset(); currentView.Apply();
Hope it will save time for somebody.