PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming LoadPicture on commandbuttons in toolbar programmaticaly?

Reply

LoadPicture on commandbuttons in toolbar programmaticaly?

 
Thread Tools Rate Thread
Old 14-02-2004, 04:46 PM   #1
NilovSerge
Guest
 
Posts: n/a
Default LoadPicture on commandbuttons in toolbar programmaticaly?



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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Old 16-02-2004, 05:58 AM   #2
mookashi
Guest
 
Posts: n/a
Default Re: LoadPicture on commandbuttons in toolbar 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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off