Word document converting to read only when agent is trying to access

Hi An agent on server has to copy the text to a word document and convert the same to tiff using a macro in the word.

when ever the agent is scheduled to run, once the agent access the word doc the word doc isconverting to read only and not processing further.

can any one sugesst the solution to the problem. The code does not have any problem because when agent ran manually it run with out any error.

Thanks in advance