tell application "Microsoft PowerPoint"
  if it is running then
    set maxSections to (get count of sections of section properties of presentation of document window 1)
    return maxSections
  else
    error "PowerPoint not running"
  end if

end tell
