Re: Word 98: get insertion point
Re: Word 98: get insertion point
- Subject: Re: Word 98: get insertion point
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 13 Feb 2001 11:29:58 -0800
On 2/13/01 10:34 AM, "Michelle Steiner" <email@hidden> wrote:
>
On 2/13/01 3:03 AM, Frank Watzl <email@hidden> wrote:
>
>
> How can I get the current position of the insertion point in an open
>
> document window (and write that information into an AS-variable)
>
>
>
> How can I (later in the script) reset the insertion point to the previously
>
> retrieved value?
>
>
It all depends on the application that opened the document.
>
I think that information is in the subject of the email.
It will depend partly on whether you alter the document at any point
previous to where the insertion point presently is. If you don't, then this
will work:
tell application "Microsoft Word"
set insPt to selection of document 1
--do stuff
select insPt
end tell
The first command gives a result like this:
set insPt to selection of document 1
----insertion point 4 of word 10 of paragraph 12 of document "PB HM Hard
Disk:Desktop Folder:clarke, L&S"
(If the document is not saved, you won't get the whole path name. In fact,
you can just use 'window 1' instead of document 1' under all circumstances,
which will just give the name of the window.)
If you've altered the document so that word is now word 27 of paragraph 17,
adjust the value of insPt accordingly, although you may need to do a bit of
fiddling around to figure out what the value should be.
--
Paul Berkowitz