AddFromString Method Example

The following example uses the AddFromString method to add a line, “Dim intJack As Integer,” to the specified code pane.

Application.VBE.CodePanes(3).CodeModule.AddFromString "Dim intJack As Integer"