• 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
Problem getting table text off PowerPoint slides
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem getting table text off PowerPoint slides


  • Subject: Problem getting table text off PowerPoint slides
  • From: Angie Frazier <email@hidden>
  • Date: Wed, 2 Sep 2009 12:51:02 -0400

I wrote some AppleScript code to get the text from all tables on a slide. The script has been working fine but I recently ran into a problem where a table will report "missing value" when I query the row or column count (even though "has table" returns "true").  I tried to make sure it wasn't a problem in my script so I added a table to a slide, entered some data into the cells, then copied the table and pasted it onto the same slide. When I run the script, the text from the second table is returned but not the first. This only seems to happen with certain slides.  Could this be a bug in PowerPoint?

Here is the AppleScript:

tell application "Microsoft PowerPoint"
    set slideNumber to current show position of slide show view of slide show window of active presentation
    set theSlide to slide slideNumber of active presentation
end tell

getTableText(theSlide)


on getTableText(theSlide)
    tell application "Microsoft PowerPoint"
        set tableList to {}
        repeat with shapeTable in (get every shape table of theSlide)
            if table object of shapeTable is not missing value then
                set numCols to number of columns of shapeTable
                set numRows to number of rows of shapeTable
               
                set tableData to {}
                set theTable to table object of shapeTable
               
                repeat with theRow in (get every row of theTable)
                    repeat with theCell in (get every cell of theRow)
                        set end of tableData to content of text range of text frame of shape of theCell
                    end repeat
                end repeat
               
                set end of tableList to {columnCount:numCols, rowCount:numRows, tableData:tableData}
               
            end if
           
        end repeat
        return tableList
    end tell
end getTableText
 _______________________________________________
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

  • Prev by Date: Re: date/Snow Leopard changed
  • Next by Date: Re: date/Snow Leopard changed
  • Previous by thread: Re: date/Snow Leopard changed
  • Next by thread: KeyboardViewerServer
  • Index(es):
    • Date
    • Thread