Thread: [Solved] Replace text of textboxes
View Single Post
 
Old 12-22-2013, 05:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I don't see any reference to textbox a named "NBL-02" in your code which, it seems to me, could be reduced to:
Code:
With ActiveDocument.Shapes("NBL-02").TextFrame.TextRange.Find
  .Text = old_text
  .Replacement.Text = "400"
  .Forward = True
  .Wrap = wdFindContinue
  .Format = False
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Execute Replace:=wdReplaceAll
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote