Copy a table in a Microsoft Word document, using AppleScript I have several hundred MS Word documents containing a single table in each. I need to copy the table, paste into Preview and save as jpeg. I can get Word to find the table, but cannot get the &quot;copy object...&quot; command to work. Suggestions welcome!
tell application &quot;Microsoft Word&quot;
    activate
    tell document 1
        count (tables)
        --  set firstTable to item 1 of tables — this does not work. Why?
        set table_list to tables
        set firstTable to item 1 of table_list
        tell firstTable
            allow page breaks
            -- allow page breaks (false) -- syntax error, () not allowed. Why?
            set allow page breaks to false -- This does not work either.
            allow page breaks
        end tell
        select firstTable -- this works! Now what?
        copy object firstTable --error -1708; doesnt understand &quot;copy object&quot;
    end tell
end tell
I simplified the example and was able to find a solution to the invalid &quot;copy object xxx&quot; command syntax. I still don't understand the the actual format for &quot;copy object ...&quot; in Word, but this works!
Script to select the first Table in an MS Word document and copy it to the Clipboard. Can be enhanced to read a folder of documents and process each one. Using list of tables can process multiple tables in a doc.
tell application &quot;Microsoft Word&quot;
activate
    set firstTable to table 1 of active document
    select firstTable
    copy object selection
end tell