With Reflection Desktop 16.2 (and greater), you can use two different approaches to centrally control and manage Reflection Desktop VBA macros.
You can save VBA macros in the SharedMacros.rd3x, SharedMacros.rd5x, or SharedMacros.rdox files and deploy them to the user data folder. When a session opens, it automatically loads the macros from the sharedMacros file that corresponds to it’s file type. (See Walkthrough: Set up and deploy a SharedMacros file)
You can save VBA macros in session document files that reside on a network share or other location and then configure local session documents to reference these shared documents. When the local session documents open, they load the macros from the documents that they reference. (See Walkthrough: Set up a Session to Reference Macros in a Session Document File )
Sharing Macros in Session Documents
Reflection Desktop supports using SharedMacros files and referencing session documents that contain VBA macros for IBM ( .rd5x and .rd3x) and VT ( .rdox) session documents. You’ll need to create at least one session document file for each type of terminal you are using. Session document files can only reference macros in the same type of session document. For example, IBM3270 sessions can only reference session documents with an .rd3xextension.
NOTE:Reflection does not support nested references to session documents. If a session references a session document that in turn references other session documents, the references in the second session document are ignored.
If you are referencing session documents or using SharedMacros files to share macros, make sure the projects in those files have unique project names. Each project name in the VBA Project editor must be unique to avoid errors caused by naming conflicts. You can change project names by modifying the project properties in the VBA editor or by creating and saving these files in Reflection Desktop 16.2 or greater.
Using SharedMacros files |
Referencing macros in shared session document files |
|
---|---|---|
Use this approach when |
You want to share macros with every session file of a specific terminal type (for example, all IBM3270 session files). |
|
You’ll need to |
|
|
Considerations |
If you want to modify any of the macros in the SharedMacros files, you’ll need to deploy these files to users. |
To prevent users from editing the macro source in session documents referenced by other sessions, consider locking and password-protecting the macro projects or using some other method to control access to these files. NOTE:When you save a macro that was downloaded from a referenced session in a local session, the modified macro source is automatically uploaded to the referenced session document. |
NOTE:Prior to Reflection Desktop version 16-2, Visual Basic code was shared by exporting and distributing code module ( .bas), class ( .cls), and form ( .frm) files that could then be imported into user session document files. This method for sharing macros is still supported. However, for new implementations, it is recommended to share macros either by including them in the SharedMacros files or by referencing session documents that contain the shared macros.