Search in the /opt/WhatEver directory for files with the extensions .txt or .doc, and print the results. Then search for the string 'foo' in the files and print the results.
find /opt/WhatEver -type f \( -iname "*.txt" -o -iname "*.doc" \) -print0 | xargs -0 grep -i 'foo'