I'm trying to write a C# app that cycles through all of the docx and PDF files in a specific directory or directories, extract the first image it finds and set it as the new thumbnail image. There are hundreds if not thousands of them, so I want to automate this process if possible. Also, the built-in Word option takes a snapshot of the whole page of the document whereas I just want the first image.
I've found many ways to extract images from a docx file, and I know how to save a docx file with the save thumbnail option from within word, but is there a way in C# that I can take a custom image and replace the existing docx thumbnail with that image?
Also, I know that Windows 10/11 uses a cache and thumbs.db files for some thumbnails (not sure if it uses that for word or not) but is there a way to replace the thumbnail image for any individual file instead of it displaying whatever it's default program icon is?
I want to be able to have for example "mydocument.docx" or even "myfile.txt" to display my custom image if looking at it through explorer using the icon view.