The de re / de dicto distinction is mentioned in a passage here from Thomas's Summa Theologiae, which I quote here using the Dominican translation.
|Unde et haec propositio, omne scitum a Deo necessarium est esse, consuevit distingui. Quia potest esse de re, vel de dicto. Si intelligatur de re, est divisa et falsa, et est sensus, omnis res quam Deus scit, est necessaria. Vel potest intelligi de dicto, et sic est composita et vera; et est sensus, hoc dictum, scitum a Deo esse, est necessarium.||Hence also this proposition, "Everything known by God must necessarily be," is usually distinguished; for this may refer to the thing, or to the saying. If it refers to the thing, it is divided and false; for the sense is, "Everything which God knows is necessary." If understood of the saying, it is composite and true; for the sense is, "This proposition, 'that which is known by God is' is necessary."|
I am not sure about the translation. 'De re' is rendered as 'about the thing', and 'de dicto' as 'about the saying. Correct-ish, but we have the difficulty of translating a Latin term which is probably being used in a technical sense. He uses the verb consuevit which means 'is usually' or 'is customarily', which suggests that the terminology was established when he was writing in the 1270s. It certainly was - the distinction is mentioned at the end of this very technical discussion probably written in Paris around the same time (Aquinas taught in Paris in the 1260s). Even Abelard, writing in the 12th century, mentions it. A dictum - literally 'what is said' - of a proposition is what is said or asserted by the proposition. In Latin it is expressed by the accusative-infinitive form, e.g.. Socratem currere which means 'that Socrates runs' or 'Socrates's running'. A de dicto proposition is thus one which has a dictum as subject. For example, in Socratem currere est verum (it is true that Socrates is running) the subject is Socratem currere, which is the dictum (or refers to it, medieval texts frequently conflate use and mention), and the predicate is verum. See Catarina's interesting paper here.
When Thomas talks about the composite and divided sense, he almost certainly means what Ockham is talking about here. (Not yet available with English translation, however). Ockham's point throughout the Summa is that the dici de omni pretty much always applies to propositions understood de re, and so Frege's puzzle does not apply in such a sense. In propositions understood de dicto, there are nearly always problems with substitution. His ideas about this are mostly in Part III-1 of the Summa, none of which is available in English online, and indeed very little of which is available offline. It is a philosophical scandal that the works of one of England's greatest philosophers are not available in the language of his own country. (For much of his life William would have spoken as well as written in Latin, but the language of ordinary people was a form of middle English similar to the English of Chaucer which would still be intelligible to us modern folks).