cancel
Showing results for 
Search instead for 
Did you mean: 

TC12, Outlook16 - select folder does not work

SOLVED
Highlighted
New Contributor

TC12, Outlook16 - select folder does not work

Hello

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.

 

What I tried is (JavaScript):

 

  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:

vars_dump_tc12_problem.png

After executing the third line an error occures:

 

JavaScript runtime error.
The operation failed.

Reproduces on both Outlook 16 and 13.
win10 x64, Office 32-bit
Please help in resolving the matter.

 

---
Nikita
1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

Re: TC12, Outlook16 - select folder does not work

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.

 
---
Nikita
3 REPLIES 3
Community Hero

Re: TC12, Outlook16 - select folder does not work

I suggest you contact Support directly about this issue.  Here's the link:

https://support.smartbear.com/testcomplete/

New Contributor

Re: TC12, Outlook16 - select folder does not work

Contacted the support 4 days ago, waiting for the response.

Will write the answer below if any.

---
Nikita
New Contributor

Re: TC12, Outlook16 - select folder does not work

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.

 
---
Nikita
New Here?
Join us and watch the welcome video:
Top Kudoed Authors