Hi All,

I'm searching for a particular word in a word document using a macro. Say for example i'm searching the word "Amount". I need to replace the very next word of the found word. Suppose there is a sentence like "Amount $5,000". I will search for the word "Amount" and have to replace the $5,000 with some other value.

One can raise a doubt why need to search for "Amount" instead of "$5,000". I will tell the reason. $5,000 will not be same in all the documents. whereas "Amount" will be constant. So I'm invoking a search t find the word "Amount" and replace the very next word. I did some coding. Can you please let me know where should i have to correct.

Set rng = objWord.ActiveDocument.Content
        rng.Find.Execute findText:="Amount", MatchCase:=True, Forward:=True
            If rng.Find.Found Then
                If rng.Information(wdWithInTable) Then
                    rng.Next.Sentences(1) = "$7,500"               
                End If
            Else
                    MsgBox "Not found"                    
            End If