title: How to edit words in specific paragraph in MSWord using win32com
body: <p>I've got a task to edit a serial of MSWord documents. What I   have to do is to change a word in paragraph 3 of each document. I want to use python to finish this job. In the document, there is a table just below paragraph 3.  The problem is that if I change the word of paragraph 3, the paragraph 3 will dispear and the words I filled in will be inside the table below.</p>
  
  <p>My code is</p>
  
  <pre><code>import os
  import win32com
  from win32com.client import Dispatch
  
  w = win32com.client.Dispatch('Word Application')
  w.Visible = 1
  w.DisplayAlerts = 0
  doc = w.Documents.Open(u'F:\\pythonlearning\\a.doc')
  
  doc.Paragraphs(3).Range.Text = 'Y\n'
  </code></pre>