Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Use macro to find in text box
I've recorded a macro in Word 2000 using Find All as this finds text in a
text box but when I run the macro, the text is not found. There seems to be no Find All option for the Find or Execute commands. -- Adrian |
#2
|
|||
|
|||
There is a problem with the macro recorder and the search command. What is
it that you are trying to find? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Adrian wrote: I've recorded a macro in Word 2000 using Find All as this finds text in a text box but when I run the macro, the text is not found. There seems to be no Find All option for the Find or Execute commands. |
#3
|
|||
|
|||
I am trying to find by Style Name and replace text in the stated style with
replacement text. This is to populate a template with data. Cannot use mail merge fields as I want header information at the top of the page and repeating information from a datasheet, which would populate text in character styles in a document table. Hence, if data [Record ID] would populate the first found character style called "Record ID". The problem is there's no wdFindAll option ! -- Adrian Price "Graham Mayor" wrote: There is a problem with the macro recorder and the search command. What is it that you are trying to find? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Adrian wrote: I've recorded a macro in Word 2000 using Find All as this finds text in a text box but when I run the macro, the text is not found. There seems to be no Find All option for the Find or Execute commands. |
#4
|
|||
|
|||
You need something like:
Sub ReplaceExample() Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find '********************** .Style = "Record ID" .Replacement.Text = "Your text here" '********************** .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Adrian wrote: I am trying to find by Style Name and replace text in the stated style with replacement text. This is to populate a template with data. Cannot use mail merge fields as I want header information at the top of the page and repeating information from a datasheet, which would populate text in character styles in a document table. Hence, if data [Record ID] would populate the first found character style called "Record ID". The problem is there's no wdFindAll option ! There is a problem with the macro recorder and the search command. What is it that you are trying to find? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Adrian wrote: I've recorded a macro in Word 2000 using Find All as this finds text in a text box but when I run the macro, the text is not found. There seems to be no Find All option for the Find or Execute commands. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
End/FootNote text style | Page Layout | |||
How do I turn select text on and use Find to select a block of te. | Microsoft Word Help | |||
How do I find my macro files for word so I can import them to my . | Microsoft Word Help | |||
change all caps in text to small lettering using find and replace. | New Users | |||
Should be simple! Macro to find italics won't run | Microsoft Word Help |