Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Macro Object / GetMacroNames Method
A MacroEnumerationOption Enumeration value that indicates the location from which the list of macro names is generated. MacroEnumerationOption_Document gets the list from this session document's VBA project. MacroEnumerationOption_CommonProject gets the list from the Common VBA project.
Example
In This Topic
    GetMacroNames Method (Macro)
    In This Topic
    Gets a list of existing macro names.
    Syntax
    expression.GetMacroNames( _
       ByVal macroSource As MacroEnumerationOption _
    ) As String()
    where expression is a variable that represents a Macro Object

    Parameters

    macroSource
    A MacroEnumerationOption Enumeration value that indicates the location from which the list of macro names is generated. MacroEnumerationOption_Document gets the list from this session document's VBA project. MacroEnumerationOption_CommonProject gets the list from the Common VBA project.

    Return Value

    A set of macro names. The set may be empty if there are no existing macros.
    Example
    This example displays a list of macros in the session document.
    Sub PrintMacroNames()
     
        Dim list() As String
        
        Dim MacroObject As Attachmate_Reflection_Objects_Emulation_IbmHosts.Macro
     
        'Get the Macro object and the list of macro names
        Set MacroObject = ThisIbmTerminal.Macro
        list = MacroObject.GetMacroNames(MacroEnumerationOption_Document)
        
        
        'Print the list
        If UBound(list) = -1 Then
            Exit Sub
        Else
            For i = 0 To UBound(list)
                Debug.Print list(i)
            Next i
        End If
     
    End Sub
    See Also