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? Thanks.
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? Thanks.
It will if you don't have any text selected and don't have Up or Down selected. -- 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. so?
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.
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 String) 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 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting 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 ! Steve
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? Thanks
5.Find/Replace: Find numbers and replace with n-1
Hi, 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 string. 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 macro? Any ideas? TIA
6. Find/Replace Header text using VBScript
Users browsing this forum: No registered users and 40 guest