Find and Replace Header in Word using applescript
I have been successfully using the following to edit content within word document, but it does not edit the content of headers and footers.
tell application "Finder" to set myFiles to every file of (choose folder)
repeat with aFile in myFiles
tell application "Microsoft Word"
set file_name to aFile as string
open file file_name
activate
set docRange to text object of active document
clear formatting of find object of docRange
execute find (find object of docRange) find text "String 1" replace with "String 2" replace replace all
save active document
close active document
end tell
delay 1
end repeat
There's a dead link in an old thread for a similar issue, so I was hoping that someone here could help.
Thanks in advance!