Search / Locate Files By Data Card Variable Value

I've searched high and low for a piece of code that will work for my task.

  1. We are storing the part number from another system (OSPN) on the Data Card of .pdf files in PDM
  2. The related files are all in one directory in PDM
  3. Given the OSPN, I need to search the Data Cards in that one directory, locate all the .pdf files with the OSPN on the Data Card, and attach them to an e-mail that I'm sending from this program

I'm already able to do this by the PDM File Name; now I need to be able to search by the Data Card variable.

If you've got a snippet, please attach

TIA!

SolidworksApi macros