Hi Brenden,
Thanks much for your solution. When I run this I'm getting "Invalid object name" error.
Scenario is, I have a folder named "Documents" under root, this "Documents" folder has children folders named "Dinnermenu", "Lunchmenu",etc., under this I have PDF files and I need to get the count of these,
Below is my structure
---root
|--Documents
|-- DinnerMenu
|--PDF1
|--PDF2
|--LunchMenu
|--PDF1
|--PDF2
|--PDF3
And these PDF should be counted based on a document type, for example: under lunch menu we have 3 PDF files, among these 2 are "Starters" document type and 1 is "Main food" document type.
So if I write query to get "LunchMenu" with "Starters" document type it should give me "2". Will it be achievable through macro? Can you help me.