Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Works okay in Word 2000, but not Word XP?

Status
Not open for further replies.

Dreamboat

Instructor
Nov 7, 1999
4,881
US
Private Sub Document_Open()
Dim cbTools As CommandBarPopup
Dim cbOfEx As CommandBarPopup
Dim cbOfMn As CommandBarButton

Set cbTools = Application.CommandBars(36).Controls(6)
cbTools.Reset

Set cbOfEx = cbTools.Controls.Add(Type:=msoControlPopup)
cbOfEx.Caption = "TheOfficeExperts Addins"
cbOfEx.BeginGroup = True

Set cbOfMn = cbOfEx.Controls.Add(Type:=msoControlButton)
cbOfMn.Caption = "Make My Calendar!"
cbOfMn.OnAction = "MakeCalendar"
cbOfMn.FaceId = "125"

End Sub

I get a type mismatch on this line:

Set cbTools = Application.CommandBars(36).Controls(6)

Happy to send file. Just email me. Anne@TheOfficeExperts.com
Please help!

:)
Anne Troy
Word and Excel Macros
Coming soon: WordX Addin!
 
I'm afraid I can't be of all that much help, since I'm using XL2000, but you should be able to type

?typename(Application.CommandBars(36).Controls(6))

in the immediate window and at least find out what the proper object type is. In XL2000, unsurprisingly, it's CommandBarPopup. Does XP have the same controls (number and order) on that commandbar? I'm not familiar at all with the Desktop commandbar...
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top