You may not say parts of the Written Torah by heart unless they are well known and fluent to everyone. Examples of which are fluent: Krias Shema, Birkas Cohanim, Parshas Hatomid, Pesukay D’zimra. (ShA – MB5)
If you see someone saying parts of the Written Torah by heart, you don’t need to protest, because some poskim hold that this prohibition is only when you are being motzi others by reciting those verses. (MB2)
Perhaps you can be lenient when lecturing to the public and it’s tiresome to have people wait for you to leaf through and find the verse in order to read it from the text. (MB3)
Tehillim can be said by heart. It’s to arouse rachamay Hasham like daavening. (MB 6)
If you are being motzi someone, don’t say the verse by heart even those that are fluent to everyone. (MB7)