I'm not sure your goal so maybe you need all the code you have written above but if you are just after all the open files using notepad (as an example, you can extend this to Word, Excel, etc.) you can use the below code which will return an array of processes.
Process[] lstNotepad = Process.GetProcessesByName("notepad");
and then if you want to find the filename you can access of each element in the array by accessing the MainWindowTitle property:
lstNotepad[0].MainWindowTitle
you will have to add the System.Diagnostics reference at to your class to use the Process function.
Does that do what you needed it to?