You are here: AxTools > CodeSMART 2007 for VB6 > Documentation > User's Guide > Custom Code > Inserting Custom Code Automatically
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

Inserting Custom Code Automatically

To insert custom code in your projects:

  1. Open the project you want to insert the custom code in.
  2. Optional. Open the code module of the component you want to insert code in, if you don't want to insert the code in the entire project or project group.
  3. Click the Insert custom code button on the Code Edit Tools toolbar in order to display the Insert custom code dialog, or select the menu entry having the same name in the CodeSMART main menu. Also, you can press the CTRL+F12 keyboard shortcut with the same effect (quick toolbar and menu references are available).
  4. Custom Code
  5. Select the operation scope. Depending on the current position in code and the active code or designer window, only valid options are listed.
  6. Select the piece of code you want to insert or create a new one. This code can contain standard parameters.
  7. Select the insertion position of the custom code by choosing one of the options in the corresponding combo-box. Depending on the indicated insertion point, you might be ask to specify a relative line number inside each member or component where you want to have the inserted code.
  8. Specify if you want to use or not the special markup lines and if they are used, specify the numeric ID that will be associated with the inserted code. Check this option if you want CodeSMART to be able to automatically remove the inserted code. You can have multiple blocks of custom code in one member or component that have the same ID.
  9. Also, specify if you want to have the inserted code indented properly by using the corresponding check box.
  10. Press Begin to start the insertion operation. Depending on the situation, a progress bar may appear to reflect the operation progress.

 Notes

  • If the insertion process will be done using markup lines, CodeSMART will insert at the specified position the following code:

    '<CSCustomCode> ID
    [THE_USER_DEFINED_CUSTOM_CODE...]
    '</CSCustomCode> ID

    where ID represents the numeric ID specified when inserting.
  • You can also insert custom code in the code window at the current line using the corresponding command from the code window shortcut menu. When this command is selected the Insert custom code window is displayed allowing you to select the piece of code that you want to insert. The dialog's caption displays the line where the code will be inserted. All you have to do is press Begin and the selected code lines will be inserted into the opened code window before the current cursor position.
See also
Custom Code Overview
Removing Custom Code Automatically

Back To Top

Copyright © 2008 AxTools - CodeSMART 2007 for VB6 - Custom Code