Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / September 2003

Tip: Looking for answers? Try searching our database.

Position of custom toolbar buttons ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
noone - 26 Sep 2003 22:54 GMT
Hello all,
Below is a snippet of code that I using in my first attempt at a COM object.
All is working fine, my question is how do I control the placement of the
custom toolbar, i.e. now it is right after the New button.

I would like to have it go after the users 'Organize' button, or if not
present
at the end of the Standard toolbar.

I've been googlin for an hour now, any help is appreciated.
Thanks.

Dim oExp As Outlook.Explorer
Dim oBar As Office.CommandBar

Set oExp = Outlook.ActiveExplorer
Set oBar = oExp.CommandBars.Item("Standard")

Set myControl = oBar.FindControl(, , "Unsolicited")

If myControl Is Nothing Then
   Set myControl = oBar.Controls.Add(, , , 2, True)
   With myControl
       .Caption = "Unsolicited"
       .FaceId = 67
       .Style = msoButtonIconAndCaption
       .Tag = "Unsolicited"
       .Visible = True
   End With
End If
Ken Slovak - [MVP - Outlook] - 29 Sep 2003 16:25 GMT
Set myControl = oBar.FindControl(, , "Organize")
If Not myControl Is Nothing Then
   lngPos = myControl.Index + 1
Else
   lngPost = 0
End If

'create the custom control here and use
If lngPos <> 0 Then
   Set myControl = oBar.Controls.Add(, , , lngPos, True)
Else
   Set myControl = oBar.Controls.Add(, , , , True)
End If

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

> Hello all,
> Below is a snippet of code that I using in my first attempt at a COM object.
[quoted text clipped - 26 lines]
>     End With
> End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.