ArcObjects Library Reference (Framework)  

IVbaApplication.InsertCode Method

Inserts code into the specified module.

[Visual Basic .NET]
Public Sub InsertCode ( _
    ByVal docName As String, _
    ByVal moduleName As String, _
    ByVal codeText As String _
)
[C#]
public void InsertCode (
    string docName,
    string moduleName,
    string codeText
);

Product Availability

Available with ArcGIS Desktop.

Description

docName specifes the name of the VBA project that contains the module in which you want to insert code.

moduleName specifes the name of the module in which you want to insert code. This module must already exist in the VBA project.

codeText is a string that represents all the code for the macro.

 

Remarks

If you want to insert code into a module in the current document, docName will be "Project".

If you want to insert code into a module in the Normal template, docName will be "Normal".

If you want to insert code into a module in a template, docName will be "TemplateProject".

The string for codeText must include all the text for the macro code including the sub procedure declaration and end sub. 

See Also

IVbaApplication Interface