Re: Microsoft: the experts in crazy-making
Re: Microsoft: the experts in crazy-making
- Subject: Re: Microsoft: the experts in crazy-making
- From: Olof Hellman <email@hidden>
- Date: Wed, 14 Mar 2007 22:26:20 -0700
What? Microsoft referred to as "experts" on the AppleScript list? :-)
On Mar 14, 2007, at 8:08 PM, Larry the O wrote:
But it always starts seraching from the beginning of the document no
matter what I do. How do I tell this silly program to start searching
from somewhere other than the beginning?
Here's a script which uses the selection object as the range to search.
It searches for the string "foo" in the fifth paragraph. If found, it
returns true, otherwise false.
tell application "Microsoft Word"
set myRange to create range active document start (start of content
of ¬
text object of paragraph 5 of active document) end (end of content ¬
of text object of paragraph 5 of active document)
select myRange
-- now paragraph 5 is selected
set selFind to find object of selection
set content of selFind to "foo"
set forward of selFind to true
execute find selFind
end tell
To maintain your sanity scripting Word, I really recommend the Word
2004 AppleScript Reference which you can download from mactopia:
http://www.microsoft.com/mac/resources/resources.aspx?
pid=asforoffice
- Olof
Microsoft MacBU _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden