Selection.Find in Word 2007

MattKnowles

New Member
I have opened a Word document and would like to find a string ("{ClientName}") within this document and replace it with another string. The macro code looks something like:

Selection.Find.ClearFormatting
With Selection.Find
.Text = "{ClientName}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute


However, I am struggling to convert this into Progress code. Any ideas please?

TIA,

Matt
 

dondeebarrera

New Member
FUNCTION fReplace RETURNS LOGICAL
( pcFindString AS CHARACTER, pcReplaceString AS CHARACTER ) FORWARD.
FUNCTION fReplace RETURNS LOGICAL
( pcFindString AS CHARACTER, pcReplaceString AS CHARACTER ) :
/*------------------------------------------------------------------------------
Purpose:
Notes: Maintained by Vicky
------------------------------------------------------------------------------*/
RETURN chDoc:Content:Find:Execute(pcFindString,0,0,0,0,0,1,1,1,pcReplaceString).
END FUNCTION.
DYNAMIC-FUNCTION('fReplace','<ReportTime>',STRING(TIME,'HH:MM')).
 
Top