Microsoft Word 和 AppleScript(更改标题)
我有 2 个文件。我希望将第一个文档的标题复制到第二个文档(完全相同,相同的格式,页码选项等......)。这是到目前为止我的源代码:
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
I have 2 documents. I want the header of first doc to be copied to the second doc (exactly, same formatting, page number options etc..). Here's my source code so far:
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 can I set refHeader to the header of doc2?
Thanks.
I tried this but it doesn't work, gives me 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来相当复杂,但这项工作可能是更好的方法,但我不确定
this seems pretty elaborate but does the job might be a better way but i"m not sure