我有两个文档。我希望将第一个文档的页眉复制到第二个文档中(保持完全相同的格式、页面编号等)。以下是我目前的源代码:
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
我该如何将refHeader设置为doc2的页眉? 谢谢。
我尝试了这个方法,但它不起作用,给了我一个错误:
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