LoadPicture on commandbuttons in toolbar programmaticaly?

  • Thread starter Thread starter NilovSerge
  • Start date Start date
N

NilovSerge

Hallo!
1 I create a toolbar with some commandbuttons programmaticaly. What
can not make is to set a
picture to the created command button:
Set NewBar
myOlApp.ActiveInspector.CommandBars.Add(Name:="Myname"
Position:=msoBarFloating, Temporary:=False)
NewBar.Visible = True
Set objButton = NewBar.Controls.Add(msoControlButton)
objButton.Caption = "Send" ' All this is working !
objButton.Picture = LoadPicture("D:\M
Work\MlProjs\Image\closed.bmp")
' Get Error "Object doesn't support this property or method"
How can I load a picture to a new button? And actually I would prefe
to get one of the system pictures
(which can be set to commandbutton by hand in tuning toolbars) and no
to load picture from a disc.
2 I create a folder programmaticaly.
Set UserFolder = SentMailFolder.Folders.Add("Some docs")
But how I can also add this folder to Panel of OutLook ???
3 I use User fields and controls connected with this fields. When I se
focus to some
control and after editing it I push a commandbutton on a toolbar t
perfom some task it appears,
that the user field is not filled with entered values, until I chang
focus on other control.
If I can apply my changes in control to user fields programmaticaly
Or the only way is to
change focus from control programmaticaly
 
you can use your custom images on your command buttons the followin
way. you will have to place a picture control in any of the forms u us
or create a dummy form and put the pic u want to use in tha
control.this works

Clipboard.Clear
Clipboard.SetData dummyform.picturecontrol.Picture, vbCFBitmap

With btnCommandButton
.PasteFace
End Wit
 
Back
Top