cancel
Showing results for 
Search instead for 
Did you mean: 

Interacting with MS Word Documents without 'locking' them

MikeThorpe
Staff
Staff
Hi guys,   I'm working on a process that interacts with a variety of MS word templates that we use, replacing with relevant information (ie replace with "John Smith"), ready to be sent out. In testing, I've found it fall down a couple of times whilst interacting with the word template meaning that the templates get locked. I think this is because my exceptions 'bubble up' rather than recover, and then close the document safely within the page.  Can someone suggest the best way to handle this scenario so that if for whatever reason the letter cannot be completed in full, an exception raises but also closes (and potentially still saves) the document in a safe way. Thanks Mike  
4 REPLIES 4

John__Carter
Staff
Staff
Mike - try intercepting the exception on the same page so that you can deal with MS Word right there. Then if necessary, throw the exception again to other, 'higher up' exception handling. You could also use a Block to pinpoint which exceptions the recover will handle.

MikeThorpe
Staff
Staff
Thanks John - I had tried that but it failed, though I think that's down to my user error rather than anything else. I've been thinking and I suppose another way to cater for this is to build something that can interact with the Locked dialogue box so that if it raises then allow me to open a local file and work with it that way. Do you know (or anyone know) how I could do this - I'm guessing there isn't anything out of the box so I'm happy to build something. However not sure whether it would fall under the same object as Word or whether it's something entirely separate. If so, how would I attach to it? Just for reference, the dialogue box is below;    

Denis__Dennehy
Level 15
Your image shows a .docx file is locked - that is not a template file so will always be locked if more than one person or robot has it open.   Instead you should be using the Word template format - .dotx  

RicherMorano
Level 2
Hi guys can you help me with this? I already have my data from a website into my collection in blue prism. How can I transfer this data and put it in a tabular manner in MS Word?  I cant create a table in ms word using blue prism. The MS Word VBO only has add rows to tables in its functions.