We usually say说的话rather than写的话.
I found some kinds of examples from有道,maybe can help you.
Examples
1.我相信他的话。
I trust his word.
(他的话=his word)
2.她误解了我所说的话。
She misunderstood what I said.
( 我所说的话=what I said)
3. 这是我从他说的话中推断出来的。
This is what I gathered from his speech.
(他说的话=his speech)
4. 我的话并不是针对你们所有人的。
My remarks were not directed to all of you.
(我的话=my remarks)
In addition
Sometimes we say”如果...的话”,as same as”if”
example
如果需要的话,可以制造一个理由。
Make up a reason if you have to.
(In this sentence,的话can be omitted,like 如果需要,可以制造一个理由,I think the difference is when you use”的话”,the sentence is more colloquial.)