Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Thomas FG Gilbert Thomas FG Gilbert is offline
external usenet poster
 
Posts: 1
Default How to do a find and replace on part of a document?

I am trying to remove index fields on part of a document. I don't want all
the sections to be indexed and because when I was indexing and hit "mark all"
it indexed sections that I did not want coded for indexing. So I need it to
stop at the end of a section when I repace all.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Daiya Mitchell Daiya Mitchell is offline
external usenet poster
 
Posts: 903
Default How to do a find and replace on part of a document?

As with all Replace All functions, best to test ON A COPY--but if you
select the part of the text you want searched, Replace All should only
affect that part, and then ask you if you want to do the rest of the
document.

Thomas FG Gilbert wrote:
I am trying to remove index fields on part of a document. I don't want all
the sections to be indexed and because when I was indexing and hit "mark all"
it indexed sections that I did not want coded for indexing. So I need it to
stop at the end of a section when I repace all.

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to do a find and replace on part of a document?

The following macro will remove the index fields from the section the cursor
is in

ActiveDocument.Bookmarks("\section").Range.Select
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^d INDEX"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll

http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

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


Thomas FG Gilbert wrote:
I am trying to remove index fields on part of a document. I don't
want all the sections to be indexed and because when I was indexing
and hit "mark all" it indexed sections that I did not want coded for
indexing. So I need it to stop at the end of a section when I repace
all.



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
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 08:48 PM
Trying to replace words with fields using Find/Replace mbleyle Microsoft Word Help 2 March 29th 06 11:35 PM
Using find and replace or macros to replace page ranges JeremyC Microsoft Word Help 7 February 13th 06 10:20 PM
Find/ Replace is auto-capping the words I want to replace with Graham Mayor Microsoft Word Help 8 January 27th 06 02:39 AM
Find/replace for tabs in a Word document Reigning in Seattle Microsoft Word Help 2 April 1st 05 07:11 PM


All times are GMT +1. The time now is 11:41 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"