# How to add some texts into Microsoft Word file in a specify place

Such as I have a office word file named file.docx.It have some text in it,Such as

I have a dfj.
This is second line.


Then I want to add some string into the place that the arrow pointting by MMA.Is it possible?

• Does it really have to be a *.docx file? The format is quite complicated (essentially a zipped bunch of XML files) that maybe a text file would be less of a headache. – J. M.'s ennui Sep 5 '17 at 2:44
• @J.M. After I save it as .xml,then I import some XMLObject.That's confusing.. – yode Sep 5 '17 at 2:56
• Yes, that's why I'm questioning you if it is really needed to deal with *.docx instead of, say, *.txt. – J. M.'s ennui Sep 5 '17 at 2:58
• @J.M. Maybe this is what you want to tell me. – yode Sep 5 '17 at 3:16
• As I mentioned, a *.docx file is essentially a *.zip file in disguise; so, you might need to do something like Import["file.docx", "word\\document.xml"] (unfortunately I do not have Office or a *.docx file for testing). – J. M.'s ennui Sep 5 '17 at 3:24

file = Import["C:\\Users\\zyd199012\\Desktop\\file.xml"]