I have 2 documents. I want the title of the first document to be copied to the second document (just like formatting, page number options, etc.). Here is my source code:
tell application "Microsoft Word"
activate
open "Macintosh HD:test.docx"
open "Macintosh HD:newtest.docx"
set doc to document "Macintosh HD:test.docx"
set doc2 to document "Macintosh HD:newtest.docx"
set refHeader to get header of section 1 of doc index header footer primary
end tell
How to set refHeader in doc2 header? Thank.
I tried this, but it does not work, gives me an error:
set refHeader to page number options of (get header of section 1 of doc index header footer primary)
set page number options of (get header of section 1 of doc2 index header footer primary) to refHeader
source
share