Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Avicenna

macrumors member
Original poster
Jul 16, 2009
89
0
Hi,
I am trying to copy header of one file to another exactly, including formatting, page number options etc...How can I do it? I tried this so far, but if I have the page number on the right side in test.docx, it doesn't carry over in newtest.docx.

How can I make it so it copies the formatting too? Here's the code so far:
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 content of text object of (get header of section 1 of doc index header footer primary)
    set content of text object of (get header of section 1 of doc2 index header footer primary) to refHeader
end tell

Thanks..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.