As it is not clear how your folders and accounts are arranged who not simply pick the destination folder also
Or you can Loop throughout the stores and select the store name which is the partially obscured 'dbable' etc then loop through the folders thereSet olFolder = Application.Session.PickFolder Set olDestFolder = Application.Session.PickFolder
Or if you are certain of the path of 'Test' which appears to be a direct sub folder of 'dbable...etc' then you can select it directlySub Test() Dim olStore As Store Dim olDestFolder As Folder For Each olStore In Application.Session.Stores If olStore.DisplayName = "dbable...etc" Then For Each olDestFolder In olStore.GetRootFolder.folders If olDestFolder.Name = "Test" Then MsgBox olDestFolder.Items.Count Exit For End If Next olDestFolder Exit For End If Next olStore End Sub
Sub Test2() Dim olDestFolder As Folder Set olDestFolder = Application.Session.Stores("dbable... etc").GetRootFolder.folders("Test") MsgBox olDestFolder.Items.Count End Sub




Reply With Quote
