I am replacing text in a word document and it is working fine except in my 'If Then-End If' statement. I can not figure out why it isn't working, so I thought I would ask for some help. I have left out all the declarations and other code so as to not take up so much space here.
VB Code:
Set objWdApp = New Word.Application Set objWdDoc = objWdApp.Documents.Open(FileName:="\\Taft\gis\test.doc") Set objwdRange = objWdDoc.Content With objwdRange.Find .Replacement.ClearFormatting .Text = "lotarea" 'this part works great. .Replacement.Text = strlotarea .Execute Replace:=wdReplaceAll If Text1(6).Text = "R6" Then 'this part gives me nothing. strlotarea = "6,000" .Text = "lotarea" .Replacement.Text = strlotarea .Execute Replace:=wdReplaceAll




Reply With Quote