Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Office > Project

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-10-2017, 07:42 AM
billcorb billcorb is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2017
Posts: 3
billcorb is on a distinguished road
Exclamation Custom command bar coontrol

I have been trying to resurrect code that worked on MS Project 98. The following code does not set the command combobox.

CommandBars.Add(Name:="IMA-sch").Visible = True
Set custBar = CommandBars("IMA-sch")
custBar.Visible = True
Set graphbtn = custBar.Controls.Add(Type:=msoControlButton)
graphbtn.FaceId = 419
graphbtn.Caption = "Sch-aid"


graphbtn.OnAction = "IMASCH_aid"
Set graphbtn = custBar.Controls.Add(Type:=msoControlButton)
graphbtn.FaceId = 7
graphbtn.Caption = "Rebuild Path List"
graphbtn.OnAction = "PthButBld"
Set graphbtn = custBar.Controls.Add(Type:=msoControlComboBox)
graphbtn.Caption = "Network Paths"
graphbtn.Tag = "Network Paths"
graphbtn.OnAction = "PthBut"


Set cmbx = custBar.FindControl _
(Type:=msoControlComboBox, Tag:="Network Paths", Visible:=True, Recursive:=True)
Cmbx is nothing.

Any suggestions will be greatly appreciated.
Reply With Quote
  #2  
Old 08-10-2017, 10:55 AM
billcorb billcorb is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2017
Posts: 3
billcorb is on a distinguished road
Default Command bars

I got it working now. I had to set the msocontrol to my command bar.

Set custBar = CommandBars("IMA-sch")
Set Cbox = custBar.FindControl _
(Type:=msoControlComboBox, Tag:="Network Paths", Visible:=True, Recursive:=True)
Cbox.Width = 36
Reply With Quote
Reply

Tags
combobox, custom control, findcontrol
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is this command? Turn-over Word 1 03-29-2017 08:10 AM
Creating a key command to add a custom header and footer GrantSaw Word 1 02-04-2015 07:46 AM
Custom table of contents referencing a custom field skaboy607 Word 3 01-16-2014 06:59 AM
assigning custom templates to custom tab rich_cirillo Word 0 10-18-2012 05:59 PM
Add-In:How to add command right click command bar phang Outlook 0 01-15-2007 02:53 AM


All times are GMT -7. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft