ublic Function AddNewItem() As Boolean
Dim ctl As CommandBarButton, Str As String
Str = Left(Screen.ActiveControl.SelText, 255)
If Not Len(Str) > 0 Then Exit Function
If CommandBars("FastSelect").Controls.Count > 20 Then CommandBars("FastSelect").Controls(10).Delete
Set ctl = CommandBars("FastSelect").Controls.Add(msoControlButton)
ctl.Caption = IIf(Len(Str) > 20, Left(Str, 20) & "...", Str)
ctl. & Str & "')"
End Function
ublic Function GetFastSelect(Str As String) As Boolean
On Error Resume Next
Dim intSelStart As Integer
intSelStart = Screen.ActiveControl.SelStart
Screen.ActiveControl.SelText = Str
Screen.ActiveControl.SelStart = intSelStart + Len(Str)
End Function