Font Size on Command Buttons - VBA

T

tcb

When I create a command button I can do all of the below except set
the FontStyle. What is the correct syntax for this?

With objActiveWkb.ActiveSheet.OLEObjects.Add("Forms.CommandButton.
1")
.Left = intLeft
.Top = intTop
.Object.Caption = strButtonCaption
.Width = intWidth
.Height = intHeight
.Object.Wordwrap = True
.Object.Font.Size = 10
' .FontStyle = "Bold"

End With
 
D

Dave Peterson

How about just

.object.fontbold = true

I don't think there's a .fontstyle associated with this. I didn't see it when I
added an oleobject to the watch window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top