I am using following code How do I convert Word files to PDF programmatically? to convert the doc file to pdf. but the code mentions getting all .doc files from specific directo
The code is looking for all .doc files in a folder and looping through them. If you jut had the one file in the folder, it would just convert that one.
You could change this line of code:
FileInfo[] wordFiles = dirInfo.GetFiles("*.doc");
to just look for your file, eg
FileInfo[] wordFiles = dirInfo.GetFiles("myselectedfile.doc");