• 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: Word Line Numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Word Line Numbers


  • Subject: Re: Word Line Numbers
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 03 Jun 2009 15:49:51 -0700
  • Thread-topic: Word Line Numbers

On 6/3/09 3:00 PM, "Thomas Maffucci" wrote:

> I have a word document Formatted with line numbers in page view.
> Does any body know how to get the line number associated with the current
> selection of text in applescript?

Thomas, this should do it:
   tell application "Microsoft Word"
       set lineNum to get selection information selection ¬
           information type first character line number
       --> "17"
   end tell

Bear in mind that the result is a string, so you'll need to coerce it if you
need a number.

HTH,
Stan C.


 _______________________________________________
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

References: 
 >Word Line Numbers (From: Thomas Maffucci <email@hidden>)

  • Prev by Date: Word Line Numbers
  • Next by Date: Re: Same code gives different answers in 2 different scripts
  • Previous by thread: Word Line Numbers
  • Next by thread: Re: Word Line Numbers
  • Index(es):
    • Date
    • Thread