find/replace on headers&footers 
Author Message
 find/replace on headers&footers

Hi all,
I process a find&replace on my word document but it does
not consider headers and footers.
Anyone has an idea to do that ?
Thx,

Uvatha



Tue, 14 Sep 2004 17:01:40 GMT  
 find/replace on headers&footers
Hi Uvatha

See:
http://www.mvps.org/word/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm

Regards

Dave

| Hi all,
| I process a find&replace on my word document but it does
| not consider headers and footers.
| Anyone has an idea to do that ?
| Thx,
|
| Uvatha



Tue, 14 Sep 2004 18:16:22 GMT  
 find/replace on headers&footers
Thx again you :)

It works perfectly !
However, as the article explains it, the method really
reduces speed, even using the Selection object for the
main document story ( first a "For Each", then inside :
a "Do While" ... ) : my document scanning downs from
35Kb/sec to 7Kb/sec ...

i think i'll try to use the " flaky " way :)
so i have a new question, i get the replace command by a :

MyWordAppli.CommandBars(1).Controls(14).Execute

but it just shows it...
i would prefer not to see the dialog box, and instead
having it really executed

Uvatha

Quote:
>-----Original Message-----
>Hi Uvatha

>See:
>http://www.mvps.org/word/FAQs/MacrosVBA/FindReplaceAllWith
VBA.htm

>Regards

>Dave



Tue, 14 Sep 2004 22:05:20 GMT  
 find/replace on headers&footers
finally i saw a way to do it but it still shows the "Word"
and its "Replace" window...

Word_Application.CommandBars.FindControl(ID:=313).Execute
SendKeys String:="{TAB}", Wait:=True
SendKeys String:="{TAB}", Wait:=True
SendKeys String:="u", Wait:=True
SendKeys String:="{ENTER}", Wait:=True
SendKeys String:="{ESC}", Wait:=True
(
http://www.mvps.org/word/FAQs/MacrosVBA/FlushPartialFindBug
.htm )

Uvatha

Quote:
>-----Original Message-----
>Hi Uvatha

>See:
>http://www.mvps.org/word/FAQs/MacrosVBA/FindReplaceAllWith
VBA.htm

>Regards

>Dave



Tue, 14 Sep 2004 22:44:15 GMT  
 find/replace on headers&footers
Hi Uvatha


You can't stop the dialog from displaying, but you *can* use SendKeys to
"really" execute it. In English versions of Word you can use something like:

    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "19 September 2000"
        .Replacement.Text = "21 Mar 2002"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    CommandBars.FindControl(ID:=313).Execute
    DoEvents
    SendKeys "%A"
    SendKeys "{Enter}"
    SendKeys "{Esc}"
    DoEvents

Regards

Dave


| Thx again you :)
|
| It works perfectly !
| However, as the article explains it, the method really
| reduces speed, even using the Selection object for the
| main document story ( first a "For Each", then inside :
| a "Do While" ... ) : my document scanning downs from
| 35Kb/sec to 7Kb/sec ...
|
| i think i'll try to use the " flaky " way :)
| so i have a new question, i get the replace command by a :
|
| MyWordAppli.CommandBars(1).Controls(14).Execute
|
| but it just shows it...
| i would prefer not to see the dialog box, and instead
| having it really executed
|
|
| Uvatha
|
|

Quote:
| >-----Original Message-----
| >Hi Uvatha
| >
| >See:
| >http://www.mvps.org/word/FAQs/MacrosVBA/FindReplaceAllWith
| VBA.htm
| >
| >Regards
| >
| >Dave



Tue, 14 Sep 2004 23:09:23 GMT  
 find/replace on headers&footers
yes i tested it, it works fast, as in Word of course
maybe there would be a way to move the "Replace" window
out of the screen ?
i really do not want it to be visible :)

Uvatha

Quote:
>-----Original Message-----
>Hi Uvatha

>Wouldn't we all! <g> I suggest you email




Wed, 15 Sep 2004 00:01:43 GMT  
 find/replace on headers&footers

Regards

Dave


| yes i tested it, it works fast, as in Word of course
| maybe there would be a way to move the "Replace" window
| out of the screen ?
| i really do not want it to be visible :)
|
| Uvatha
|
|

Quote:
| >-----Original Message-----
| >Hi Uvatha
| >
| >Wouldn't we all! <g> I suggest you email




Wed, 15 Sep 2004 00:21:35 GMT  
 find/replace on headers&footers
i thought it was just a joke...
...wasn't it ? ;-)

Uvatha

Quote:
>-----Original Message-----
>Not possible - as I said, I suggest you email


Quote:

>Regards

>Dave



Thu, 16 Sep 2004 02:01:56 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How To Find/Replace in Headers and Footers?

2. Find/Replace in Header/Footer

3. Find and Replace fails to replace all sections of footer

4. Help Replace Headers Footers w/ Autotext?

5. How to find if the header and footer has content

6. headers & Footers

7. Dynamic Header&Footer

8. Find & Replace entire doc, ie Footers/Headers as well

9. Header & Footer problems

10. Disabling Header & Footer

11. Copying a document without its Headers & Footers

12. Question on Headers & Footers

 

 
Powered by phpBB® Forum Software