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

Re: Microsoft Word Tables


  • Subject: Re: Microsoft Word Tables
  • From: Stan Cleveland <email@hidden>
  • Date: Tue, 14 Dec 2010 18:50:00 -0800

On Dec 14, 2010, at 5:59 PM, Gil Dawson wrote:

Anybody work with tables in Word?  I'd like to "get" and "set" the values in cells, using row and column numbers, as I do in Excel.  

This much I got...

tell application "Microsoft Word"
get name of document 1
--> "My Table Tests"
get uniform of table 1 of document 1
--> true
get row index of row 3 of table 1 of document 1
--> 3
get column index of cell 4 of row 3 of table 1 of document 1
--> 4
get value of cell 4 of row 3 of table 1 of document 1
--> missing value
get contents of cell 4 of row 3 of table 1 of document 1
--> missing value
get every text of cell 4 of row 3 of table 1 of document 1
--> current application
end tell

Hi Gil,

This may get you going again. The code below returns the correct cell contents, but always with a return appended to the end. You may want to strip that off. Numbers are also returned as strings with a trailing return.

tell application "Microsoft Word"
tell table 1 of document 1
set blah to content of text object of cell 1 of row 2
end tell
end tell

HTH,
Stan
 _______________________________________________
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

  • Follow-Ups:
    • Re: Microsoft Word Tables
      • From: Gil Dawson <email@hidden>
References: 
 >Microsoft Word Tables (From: Gil Dawson <email@hidden>)

  • Prev by Date: Microsoft Word Tables
  • Next by Date: Re: Spotlight Indexing
  • Previous by thread: Microsoft Word Tables
  • Next by thread: Re: Microsoft Word Tables
  • Index(es):
    • Date
    • Thread