Jump to content

_WordDocFindReplace in header / footer


ndandy
 Share

Recommended Posts

  • 2 weeks later...

Here my solution:

; find and replace in body
$oDoc.Range.Select();  
_WordDocFindReplace($oDoc,$search,$replace,2,-1)    
  
$count_sections=$oDoc.Sections.Count()
For $sec_i=1 To $count_sections

  ; select one header section 
  $oDoc.Sections($sec_i).Headers(1).Range.Select()
  ; replace in header
  _WordDocFindReplace($oDoc,$search,$replace,2,-1)  

  ; select one footer section
  $oDoc.Sections($sec_i).Footers(1).Range.Select()
  ; replace in footer
  _WordDocFindReplace($oDoc,$search,$replace,2,-1)  
    
Next
  
; restore print layout view
$oDoc.Activewindow.View.Type = 6

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...