Reply
 
Thread Tools Display Modes
  #1   Report Post  
Jeff Janoski
 
Posts: n/a
Default Is there a way to find and replace a text string with a field nam.

I would like to replace a text string with a field name throughout the entire
document. The find/replace does not allow me to insert a field name. Is
there another way?
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

You would need to use a bit of VBA code for this:

Dim myrange as Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
While .Execute(FindText:="some string", MatchWildcards:=False,
Wrap:=wdFindStop, Forward:=True) = True
Set myrange = Selection.Range
Code to add the field using ActiveDocument.Fields.Add myrange, etc
Wend
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Jeff Janoski" Jeff wrote in message
...
I would like to replace a text string with a field name throughout the
entire
document. The find/replace does not allow me to insert a field name. Is
there another way?



  #3   Report Post  
Graham Mayor
 
Posts: n/a
Default

Type the field in the document, copy it to the clipboard, then replace your
text with the content of the clipboard (^c).

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Jeff Janoski wrote:
I would like to replace a text string with a field name throughout
the entire document. The find/replace does not allow me to insert a
field name. Is there another way?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find & replace "text form fields"? OneClothEar Microsoft Word Help 1 April 13th 05 10:15 PM
Problem with function "Find and Replace" in Word. Pat Microsoft Word Help 3 March 16th 05 01:04 PM
I want to replace black text with a different text of another colo Oftheson Microsoft Word Help 2 March 9th 05 10:41 PM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM
change all caps in text to small lettering using find and replace. Jackson State New Users 3 January 13th 05 06:41 AM


All times are GMT +1. The time now is 10:53 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"