The following procedure creates a hotlist called Midwest, and adds two items to it. The first item uses the RunMacro method to call the Indiana macro, which displays a message box. The second uses TransmitAnsi to transmit text to the host.

Note that double quotation marks surround the arguments to the RunMacro method. This is because the RunMacro command is itself an argument to AddHotlistItem. You must use doubled quotation marks to indicate literal strings within other literal strings.

The line continuation character (a space followed by an underscore) is used to break up the longer lines.

Sub CreateHotlist()

With Session

'Create a new hotlist

.NewHotlist "Midwest", rcNoOptions


'Add a hotlist item that runs the Indiana macro (below)

.AddHotListItem "Midwest", "Indiana", _

"RunMacro ""Indiana"","""" ", rcNoOptions


'Add a hotlist item that transmits text

.AddHotListItem "Midwest", "Michigan", _

"TransmitAnsi ""Michegan""", rcAtNextField


'Create a standard toolbar button that displays the hotlist

.DefineToolbarButton "Standard", 12, False, _

"", 0, "", 0, "Midwest", "", "", _

".ShowHotlist ""Midwest"", 2, 2, 0, rcFullSize"

End With

End Sub


Sub Indiana()

MsgBox "Indiana"

End Sub