0

how to find and replace text in ms word 2003 using python ? I want to search a word in a table and paragraphs as well.

Thank You !

http://msdn.microsoft.com/en-us/library/f1f367bx.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-9

How to implement this in Python ?

user2481458
  • 31
  • 1
  • 8

2 Answers2

0

I think you can refer this link How to read contents of an Table in MS-Word file Using Python?

You can access the table contents with particular row and column.

Community
  • 1
  • 1
Bharathi
  • 337
  • 1
  • 5
  • 17
0
def fetchpnum(self,searchable):
        # print self.doc1.Paragraphs.Count
        for i in range(1, self.doc1.Paragraphs.Count):
            value = self.doc1.Paragraphs(i).Range.Text.lower()
            if value.startswith(searchable.lower()):
                return i
        return 0
Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112
user2481458
  • 31
  • 1
  • 8