Dim code As String Dim frm As System.Windows.Forms.Form = System.Windows.Forms.Form.ActiveForm Dim obj = frm.controls("SplitContainer1") If obj.name="SplitContainer1" Then Dim editor = obj.panel1.controls("MyCodeEditor21").Controls("SplitContainer1").Panel1.Controls("SplitContainer2").panel1.controls("Editor") CurrentTable.value = editor.text.replace(chr(10), vbcrlf) End If