Its very strange...
I had 2 subfolders of Skipped created (Unknown and Duplicates) and was trying to set a variable to the "Unknown" folder.
it keeps erroring saying an object could not be found. SO i did the following code to test
Set UNK works as you can see the debug results...Code:Set OTL = New Outlook.Application Set ONS = OTL.GetNamespace("MAPI") Set LCDf = ONS.Folders("LCDisputeDB") Set INBX = ONS.Folders("LCDisputeDB").Folders("Inbox") Set SKIPD = ONS.Folders("LCDisputeDB").Folders("Skipped") Set UNK = LCDf.Folders("Skipped").Folders.Add("Unknown") Debug.Print SKIPD = UNK.Parent.Name 'True Debug.Print SKIPD.FolderPath '\\LCDisputeDB\Skipped Debug.Print UNK.FolderPath '\\LCDisputeDB\Skipped\Unknown Set UNK2 = SKIPD.Folders("Unknown")
But when I set a variable to the Unknown it says its not there?
I can also do
Debug.Print SKIPD.folders.Count and get 0 ???
also tried
Set UNK2 = ONS.Folders("LCDisputeDB").Folders("Skipped").Folders("Unknown")
it cant see it!?? but yet UNK is created...




Reply With Quote