Find & Replace in a header



  • 1. Word XP question
    I have Word XP installed on the computer. Occasionally when I look at documents, the bottom portion is blacked out making it unoperable. I can see the words when I use the View Document feature, but, if I go back to regular view, blackened out again. Any suggestions to resolve this? Thanks
  • 2. Using " "
    In Word 2003 everytime I enter a "-mark it prints at a weird angle. How do I get it to print normally? Thanks...jcs
  • 3. vertical alignment problem
    Hello, I am having difficulty with vertical alignment. I am preparing a document which I will have printed out 2 pages per sheet, and I want the top and bottom lines both aligned from left to right across both pages on the sheet, as one would see in a book. I find that by setting the vertical alignment to "justified" I end up with the top lines all aligning just fine. But the bottom lines are not aligned. There is more space at the bottoms of the odd pages than the even pages. Strangely, the odd pages align with each other just fine, and the even pages also align with each other, as I can see from examining a print preview. But that leaves me with every sheet having more blank space underneath the odd than the even pages. Could this have to do with the fact that I have different headers/footers for odd and even pages, as well as a different header/footer for the first page? Thanks so much for any ideas. Josh
  • 4. How do I change the location of a folder?
    I need to reorganize my folders. How can I change the location of a folder from being a "sub-folder" to a primary folder?
  • 5. filename macro
    I created a macro to insert the file name in a document. When I am in print view, that macro shows as "{FILENAME / *MERGE FORMAT }. However, when the doc prints, the actual filename shows up. Can't figure out what's wrong. I'm not performing a merge.

Find & Replace in a header

Postby RG91Z2xhcyBBZGFtcw » Thu, 10 Feb 2005 23:57:02 GMT

I have noticed that when I find and replace, Word does not seem to search 
through the contents of my headers and footers.  How can I get it to do so?  

Re: Find & Replace in a header

Postby Suzanne S. Barnhill » Fri, 11 Feb 2005 08:26:57 GMT

It will if you don't have any text selected and don't have Up or Down

Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site:  http://www.**--****.com/ 
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Re: Find & Replace in a header

Postby Daiya Mitchell » Fri, 11 Feb 2005 10:29:47 GMT

However, it will search through all the text in the main part first, and
*then* search the headers--so you have to give it time--Word does not search
by pages.

Similar Threads:

1.Find/Replace Text in Headers

The find/replace feature of VBA doesn't seem to work 
within headers & footers.  HELP.

I'm attaching my generic code below for your review.

Sub ReplaceHeadersFooters(sFind As String, sReplace As 

    Dim MySelection As Variant
    Dim vntStories As Variant
    Dim x As Long
    With ActiveDocument

        For x = 0 To .StoryRanges.Count - 1
            Set MySelection = ActiveDocument.StoryRanges(1)
            With MySelection.Find
                .Text = sFind
                .Replacement.Text = sReplace
                .Forward = True
                .Wrap = wdFindContinue
                .Format = False
                .MatchCase = True
                .MatchWholeWord = False
                .MatchWildcards = False
                .MatchSoundsLike = False
                .MatchAllWordForms = False
                .Execute Replace:=wdReplaceAll
            End With
        Next x
    End With
End Sub

2.replace field in primary header using find and replace in a macro

OK this is my situation

I can record a macro and as I am recording it the process works fine.
I replace the field function Time with a Createdate one and it does this in 
a Primary header's fields aswell as the main document area.

all the fields in question are inside primary headers

upon re-running the macro it fails.

regardless of where I place the cursor prior to running the macro.

please help me - I am in danger of  becoming insane over this !

This is the macro 

Sub Replacer()
' Replacer Macro
' Macro recorded 05/08/2008 by Simun
    ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
    With Selection.Find
        .Text = "TIME"
        .Replacement.Text = "CREATEDATE"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
End Sub

Thanks in advance for any help !


3.replace field in primary header using find and replace in a ma

4.find & replace but don't replace one character in find

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: intel

I want search a text block for a paragraph followed by any digit and replace the paragraph mark with a tab and keep the digit that was there. I could do the search 10 times changing the search/replace from 0 thru 9, but can't I use a wildcard or some other trick in the replace string so that I can use the any digit string - ^# - in the find function and do the procedure 1 time?

5.Find/Replace: Find numbers and replace with n-1


this is not strictly a VBA question (rather about the advanced find/
replace feature), but close:

I'm trying to find out how to find certain numbers inside specific
text strings, modify the text string and replace each number with n-1
(i.e. make >abc=1< to #xyz=0#, >abc=2< to #xyz=1# etc.).
I know how to modify the text string while *preserving* the numbers,
but have no idea how to calculate the n-1 number in the replacement

So I would search for something like \>abc\=([0-9]{1,})\<
and replace it with .... what?

Is there a way to do this w/ find/replace or do I need a full VBA

Any ideas?

6. Find/Replace Header text using VBScript

7. Find & replace in headers and footers

8. Find and Replace won't work in footers & headers

Return to MS WORD


Who is online

Users browsing this forum: No registered users and 40 guest