Hello,
I want to replace the highlighted fields from word document with some some other data. plzz help me out to find a way

Hello,
I want to replace the highlighted fields from word document with some some other data. plzz help me out to find a way

Hi @sarvesh.b ,
Can you confirm Particulars and Amount will be the same. which you marked red color.
Thanks!
Yess, that will be same for all the formats.
yess, this is for replace but first i need to get the highlighted texts and then replace with this activity. how do i will get that text field that is the main task.
Hi @sarvesh.b
For your specific case, try the VB script code below.
Imports Microsoft.Office.Interop.Word
Open the document file.
Dim app As New Application()
Dim doc As Document = app.Documents.Open(“C:\MyDocument.docx”)
Loop through the tables in the document.
For Each tbl As Table In doc.Tables
Loop through the rows in the table.
For Each row As Row In tbl.Rows
Loop through the cells in the row.
For Each cell As Cell In row.Cells
Replace the value in the cell with a new value.
cell.Range.Text = cell.Range.Text.Replace(“oldValue”, “newValue”)
Next
Next
Next
Save the document and close the application.
doc.Save()
app.Quit()