Home Forums General XMetaL Discussion Global Function and variable Reply To: Global Function and variable

Derek Read

Reply to: Global Function and variable

Although you can declare a function in any macro the event called On_Macro_File_Load is a good place to declare them (it is a clean place to do it and this event runs when an MCR is loaded, so the function will be there provided the MCR loaded).

To store values for document-level macros you can use these:

DocumentProperties (and its associated APIs “add“, “item” and “count“)

The actual API you use to get to DocumentProperties is ActiveDocument.CustomDocumentProperties.

For application-level macros you can use Application.CustomProperties.