• 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
Microsoft: the experts in crazy-making
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Microsoft: the experts in crazy-making


  • Subject: Microsoft: the experts in crazy-making
  • From: Larry the O <email@hidden>
  • Date: Wed, 14 Mar 2007 17:53:14 -0700

Trying to script MS Word is driving me to slay the faceless beast. ARRRGHH!!

Sorry. Latest conundrum:

I'm trying to search for, select, and modify text in documents. The documents are formatted like this:

- word count -
<empty line>
- title -
<empty line>
-body text paragraph 1 -
<empty line>
- body text paragraph 2 - 

....and so forth.

The problem is that I want to exclude the title from the search. Figuring that each Word counts each line as a paragraph, I've tried to set the insertion point to the beginning of the body text and search forward:

tell application "Microsoft Word"
set wholeStory to (create range active document start 0 end (count of characters in active document)) 
set wholeStoryText to content of wholeStory



--set start of selection to first character of active document
set selection's selection start to (first character of paragraph 5 of wholeStoryText)
set selection's selection end to (first character of paragraph 5 of wholeStoryText)
set selFind to find object of selection
set content of selFind to "foo"
set forward of selFind to true
execute find selFind


end tell

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?

I know this is a very powerful AS implementation, but it is cryptic and not well documented. Feh!

Larry the O
 _______________________________________________
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: time to gmt
  • Next by Date: Re: time to gmt
  • Previous by thread: Re: time to gmt
  • Next by thread: Re: Microsoft: the experts in crazy-making
  • Index(es):
    • Date
    • Thread