A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Create TextBox in Outlook toolbar



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 29th 09, 09:26 AM posted to microsoft.public.outlook.program_vba
paresh
external usenet poster
 
Posts: 66
Default Create TextBox in Outlook toolbar

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(TOO LBARNAME)
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("MyTo olbar").FindControl(, ,
"891", False, True)
If TypeName(DESDialButton) = "Nothing" Then
Set DESDialButton =
MyToolbarApp.ActiveExplorer.CommandBars.Item("MyTo olbar").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
Ads
  #2  
Old September 29th 09, 01:48 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Create TextBox in Outlook toolbar

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"paresh" wrote in message
...
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(TOO LBARNAME)
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("MyTo olbar").FindControl(, ,
"891", False, True)
If TypeName(DESDialButton) = "Nothing" Then
Set DESDialButton =
MyToolbarApp.ActiveExplorer.CommandBars.Item("MyTo olbar").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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant add a textbox to Outlook 2003 Main toolbar metramo Outlook - General Queries 0 March 29th 08 09:01 AM
Need help to create a toolbar for outlook 2007 C# Al Add-ins for Outlook 1 February 13th 08 04:50 PM
create a Toolbar button for Calendar in Outlook 2003 Dan Outlook and VBA 1 November 23rd 07 07:44 PM
create shortcut to folder in outlook toolbar [email protected] Outlook - General Queries 1 February 15th 06 04:16 PM
create shortcut to folder in outlook toolbar [email protected] Outlook - General Queries 0 February 14th 06 09:10 PM


All times are GMT +1. The time now is 06:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.