ndandy Posted September 2, 2008 Share Posted September 2, 2008 How to use _WordDocFindReplace in the header and in the footer section of a word document? Link to comment Share on other sites More sharing options...
Bert Posted September 2, 2008 Share Posted September 2, 2008 http://www.autoitscript.com/forum/index.ph...0&hl=header The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ndandy Posted September 2, 2008 Author Share Posted September 2, 2008 http://www.autoitscript.com/forum/index.ph...0&hl=headermy problem is quite different. I use the Word UDF function, _WordDocFindReplace , that does the search and replacement only in the content of the document. How can I include the replacement in the header and in the footer also? Link to comment Share on other sites More sharing options...
ndandy Posted September 9, 2008 Author Share Posted September 9, 2008 It's impossible with Word UDF functions. Link to comment Share on other sites More sharing options...
ndandy Posted September 18, 2008 Author Share Posted September 18, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now