D
David_Loughry
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have a bookmark in the header of a word document. I am trying to write some applescript to update the contents of the bookmark (which automatically deletes the bookmark) and then re-create the bookmark so that I am able to run the script multiple times on the one document.
My problem is that I have been unable to find a way of creating a bookmark in the header.
I have found the following code which is meant to replace the content of a bookmark and then re-create it. The code works fine within the main body of the document but I am unable to get it to work in the header.
Any suggestions?
=====================
tell application "Microsoft Word"
set bmRange to text object of bookmark "myBookmark" of active document
set bmStart to bmRange's start of content
set content of bmRange to "Inserted Text"
set bmEnd to bmStart + (count "Inserted Text"
make new bookmark at active document with properties {name:"myBookmark", start of bookmark:bmStart, end of bookmark:bmEnd}
end tell
My problem is that I have been unable to find a way of creating a bookmark in the header.
I have found the following code which is meant to replace the content of a bookmark and then re-create it. The code works fine within the main body of the document but I am unable to get it to work in the header.
Any suggestions?
=====================
tell application "Microsoft Word"
set bmRange to text object of bookmark "myBookmark" of active document
set bmStart to bmRange's start of content
set content of bmRange to "Inserted Text"
set bmEnd to bmStart + (count "Inserted Text"
make new bookmark at active document with properties {name:"myBookmark", start of bookmark:bmStart, end of bookmark:bmEnd}
end tell