• 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
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: James Murphy <email@hidden>
  • Date: Sun, 12 Jun 2005 07:57:38 -0700

Michael Ghilissen asked the following question:

"How do you get/set the text object of a cell of a Word table with AS? I
tried all the variations I could think of, unsuccessfully."


Here is an example that might help

tell application "Microsoft Word"

    

    -- make a new document
    set myDoc to make new document

    

    -- make a table in this document
    set myTable to make new table at beginning of myDoc ¬
        with properties {number of columns:4, number of rows:4}

    

    -- to get a specific cell

    

    set myCell to get cell from table myTable row 1 column 3

    

    set myTO to the text object of myCell
    set the content of myTO to "hi there"

    

    -- to iterate through cells in a table

    

    repeat with columnIndex from 1 to number of columns of myTable
        repeat with rowIndex from 1 to number of rows of myTable
            set curCell to get cell from table myTable row rowIndex column columnIndex
            set curTO to the text object of curCell
            set the content of curTO to "Cell: row " & rowIndex & " column " & columnIndex
        end repeat
    end repeat

    

    

end tell


enjoy!

Jim "Murf" Murphy


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Script Objects - help please!!
  • Next by Date: Re: Script Objects - help please!!
  • Previous by thread: (no subject)
  • Next by thread: HP Scanning made a bit easier?
  • Index(es):
    • Date
    • Thread