Copy-Paste content from a Word file to a text file

Hi Everyone, nice to be here. I am new to automation and robot framework, I am using pycharm to code and I am stuck attempting to copy paste Word file content to a RTF field. I used Get File and Get Binary File but it pastes the content in a different format.
So can someone help me copy-paste content from a Word file document with it’s formatting intact (such as indentation, bolds, italics, bullets and what not) on to a rich text field? I am expecting to get the same result as I would when I copy-paste manually from a Word file onto a rich text field (RTF)

Hi Nirmalya,

MS word files are a proprietary format;

  • Get File, will only return the text if the file is plain texts (not in this case)
  • and Get Binary File, will return the binary data in a binary file but won’t decode it

I’m not sure if there’s a robot framework library that reads word documents or not?

There is the python docx module that you could use to create a python keyword for reading the data from a document, but I believe it only supports docx files (Word 2007+), if that works for you.

Dave.

1 Like