Creating a Macros File

 

Introduction

The Microsoft VBA (Visual Basic for Applications) development environment lets you use (add) a number of macros files, each containing a number of macro and/or class modules.

 

To create your own VBA macros to extend RC-WinTrans' functionality, you must start by creating your own macros file and adding your macros to it.  There is no limit to the number of user macros files that can be added to the system.

 

NOTE: A new macros file  cannot be created using the Microsoft VBA development environment, nor is it possible to add an existing macros file there.  Use RC-WinTrans to perform these two tasks.

 

 

Creating a New Macros File

Use the New Macros File dialog box to create a new VBA macros file.  This dialog is opened with the Macros Files command located in the Tools menu.

 

Any of the following templates can be used to create a new macros file:

1.

"Initial (Empty) Macros File"

2.

"With Module-Initializing Procedures"

3.

"With Module-Initializing Procedures and Event Handler Class"

4.

"File Converter"

 

After the new macros file has been specified in the New Macros File dialog box it will be added to the VBA system in RC-WinTrans where it can be used to implement user-defined procedures, functions, and classes.

 

 

Macros File Templates

There are four template files available for creating a new macros file.

 

·

Template 1: "Initial (Empty) Macros File"

An empty macros file.

 

·

Template 2: "With Module-Initializing Procedures"

A macros file with a module that has a function and a procedure:

"OnInitModule"

A function that is called when the macros file is ready to use in RC-WinTrans' integrated VBA system.  The function is called after RC-WinTrans is started and after the VBA system has been initialized and is running.

"OnTerminateModule"

A procedure that is called when RC-WinTrans is about to be closed.

 

·

Template 3: "With Module-Initializing Procedures and Event Handler Class"

A macros file with module-initialization procedures (Template 2) and an implemented event handler class to catch events from RC-WinTrans.  A number of event handler procedures are implemented but deactivated (procedures set as comments).  Examples of this include a procedure of the event handler class that catches the "OnPressFunctionKey" event from RC-WinTrans whenever a function key (F1 – F12) is pressed.  Another procedure catches the "OnSelectTransUnit" event that is thrown when a translation unit is selected in RC-WinTrans' Text Table view.

 

·

Template 4: "File Converter"

A macros file with three predefined functions.  These functions make up the "File Converter" interface function that is called by RC-WinTrans to read and write a custom file type.

 

^ Top ^