The command
nb = CreateDocument[{}]
opens an empty notebook. What I want to do is to redirect messages as generated by Mathematica so that they appear in this empty notebook. For example, when I enter
1/0
I want to see the generated message Power::infy in the notebook nb instead of in the notebook I am working in or in the Messages Window. Can someone give a hint how that can be done?
Of course, I want to switch off this behaviour when the notebook nb is closed.