AddFromString Method

Applies To

CodeModule object.

Description

Adds text to a module.

Syntax

object.AddFromString

The object placeholder is an object expression that evaluates to an object in the Applies To list.

Remarks

The AddFromString method inserts the text starting on the line preceding the first procedure in the module. If the module doesn't contain procedures, AddFromString places the text at the end of the module.

See Also

CreateEventProc method, DeleteLines method, InsertLines method, Lines method, ProcBodyLine method, ProcCountLines method, ProcOfLine method, ProcStartLine method, ReplaceLine 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"