• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Microsoft: the experts in crazy-making
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: Passing MS Word object specs (Larry the O)
  • Next by Date: Re: Microsoft: the experts in crazy-making
  • Previous by thread: Microsoft: the experts in crazy-making
  • Next by thread: Re: Microsoft: the experts in crazy-making
  • Index(es):
    • Date
    • Thread