Create TextBox in Outlook toolbar

  • Thread starter Thread starter paresh
  • Start date Start date
P

paresh

Hi, I have below code in my Outlook VBA code which creates tool bar and
button. I also want to create the TextBox and when user enter something into
TextBox and press Enter, it should show message. Could any one tell me how
could I do it?

Private Sub CreateToolBar()
Const TOOLBARNAME = "MyToolbar"
Dim ofcBar As Office.CommandBar
On Error Resume Next
'Test to see if the toolbar already exists'
Set ofcBar = Outlook.Application.ActiveExplorer.CommandBars(TOOLBARNAME)
On Error GoTo 0
If TypeName(ofcBar) = "Nothing" Then
'Create the toolbar'
Set ofcBar =
Outlook.Application.ActiveExplorer.CommandBars.Add(TOOLBARNAME, msoBarTop,
False, True)
Set DESDialButton =
MyToolbarApp.ActiveExplorer.CommandBars.Item("MyToolbar").FindControl(, ,
"891", False, True)
If TypeName(DESDialButton) = "Nothing" Then
Set DESDialButton =
MyToolbarApp.ActiveExplorer.CommandBars.Item("MyToolbar").Controls.Add(msoControlButton, , "891", , True)
End If
With DESDialButton
.BeginGroup = True
.Caption = "MyButton"
.Enabled = True
.OnAction = "!<DESDialAddin.Connect>"
.FaceId = 275
.Style = 3
.Tag = "891"
.Visible = True
End With
End If
ofcBar.Visible = True
Set ofcBar = Nothing
End Sub
 
You can't. There is no textbox control for command bars. As close as you'd
get is a dropdown control and that's something quite different.
 
Back
Top