RE: Printing to file - write-protected or in use
Let me list what comes to my mind about the problems of not being able to open this type of file;
The file path may be incorrect.
You may not be authorized to open it.
The file may be open in Someone else.
In the code(or manually), you may be forgetting to close the file and trying to open it a second time.
In the code, the file is expected to be created, but it never occurred.
There may be different problems in connections over the network.
First of all, can you check it manually?(Can you check "\\tsclient\D\h.pdf" file is exists and Can you open it)
Did you choose the address? Can you try different addresses?
Can you check if the file is open in task manager?