Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel i've got a word file .... with a non uniform table in it in which i need to write some text.......(by non uniform i mean that i've got more than one table nested one into another , that the table isn't square shaped and it's not possible to identify the cell in which i need to write into by column or row number) (At least for me)....
By "not possible to identify the cell", do you mean that there isn't a
systematic way to describe it, or that it is hard to express this in a
way that applescript will handle it?
If the former, scripting will be hard and it is best to encode the
significance of the cells in the document template (like you did with
the search/replace approach).
if the latter, then some ideas for playing with Applescript:
1) get the Word 2004 Applescript reference guide:
http://download.microsoft.com/downl...-B252-F09C465CE29C/Word2004AppleScriptRef.pdf
2) check out Microsoft's online info for scripting in 2008:
http://www.microsoft.com/mac/developers/default.mspx
3) Run simple test scripts to understand the document structure.
E.g.:
Create a new document, and insert a 5x2 table in it. Fill the cells.
In 2nd cell of row 2, paste in a 2x2 table (to give you the nested
tables)
The first table is directly accessed as "table 1 of active document",
and you can get some idea of the nested table with:
tell application "Microsoft Word" to get properties of cell 2 of row 2
of table 1 of active document
and
tell application "Microsoft Word" to get tables of cell 2 of row 2 of
table 1 of active document
You might then try something like:
tell application "Microsoft Word"
set myCell to cell 2 of row 2 of table 1 of active document
get content of text object of (cell 2 of row 1 of (table 1 of
myCell))
end tell
Matt