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:
  1. Set objWdApp = New Word.Application
  2.     Set objWdDoc = objWdApp.Documents.Open(FileName:="\\Taft\gis\test.doc")
  3.     Set objwdRange = objWdDoc.Content
  4.     With objwdRange.Find
  5.     .Replacement.ClearFormatting
  6.  
  7.     .Text = "lotarea"                                   'this part works great.
  8.     .Replacement.Text = strlotarea
  9.     .Execute Replace:=wdReplaceAll
  10.  
  11.    
  12.     If Text1(6).Text = "R6" Then                   'this part gives me nothing.
  13.     strlotarea = "6,000"
  14.    .Text = "lotarea"
  15.     .Replacement.Text = strlotarea
  16.     .Execute Replace:=wdReplaceAll