![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I know that Command bar button have property FaceId, and if i assign
this property to some value (472 for example) an icon appears. Is it possible to register my icon in system somehow, so it would have an Id? thanks a lot Donald |
#2
|
|||
|
|||
![]()
No. For putting your own icon (actually a 16x16x256 color BMP file) on a
button you use the .PasteFace method for Outlook 2000 or later or the .Mask and .Picture properties for Outlook 2002 or later. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "donald" wrote in message oups.com... I know that Command bar button have property FaceId, and if i assign this property to some value (472 for example) an icon appears. Is it possible to register my icon in system somehow, so it would have an Id? thanks a lot Donald |
#3
|
|||
|
|||
![]()
You can't technically create a new face id for a custom icon. What you can
do is use the PasteFace to paste a new image from the clipboard to the button. Here are some links that could get you pointed in the right direction. http://www.rdpslides.com/pptfaq/FAQ00495.htm http://hacks.oreilly.com/pub/h/2553 http://www.c-sharpcorner.com/UploadF...a-2b57677c1e79 http://msdn2.microsoft.com/ms268747.aspx Regards, Thaddaeus "donald" wrote in message oups.com... I know that Command bar button have property FaceId, and if i assign this property to some value (472 for example) an icon appears. Is it possible to register my icon in system somehow, so it would have an Id? thanks a lot Donald |
#4
|
|||
|
|||
![]()
i going this in outlook 2003
trying with this code in a COM add-in for outlook 2003 but it doesn't work becuase it doesn't find the command LoadPicture. Any help please Donald Sub DisplayNewImage( ) Dim cbar As CommandBar Dim cbarctrl As CommandBarControl Dim pImage As IPictureDisp Dim pMask As IPictureDisp Dim sImageFile as String Dim sMaskFile as String sImageFile = "C:\Documents and Settings\My Documents\tarsier.bmp" sMaskFile = "C:\Documents and Settings\My Documents\mask.bmp" Set cbar = CommandBars.Add(Name:="My Picture", Position:=msoBarFloating) Set cbarctrl = cbar.Controls.Add(Type:=msoControlButton) Set pImage = stdole.StdFunctions.LoadPicture(sImageFile) Set pMask = stdole.StdFunctions.LoadPicture(sMaskFile) cbarctrl.Picture = pImage cbarctrl.Mask = pMask cbar.visible = True End Sub |
#5
|
|||
|
|||
![]()
What it looks like you are trying to do is load the picture from the
clipboard. If the picture and mask are not in the clipboard you cannot get them out of the clipboard. Here is my code that does what you are trying to do. using stdole /// summary /// AxHost2 is a derivative of AxHost for getting IPictureDisp from a .NET image type /// /summary internal class AxHost2 : AxHost { public AxHost2() : base(null) {} new public static IPictureDisp GetIPictureDispFromPicture(Image image) { return (IPictureDisp) AxHost.GetIPictureDispFromPicture(image); } } public static void AssignButtonImageAndMask(ref CommandBarButton button, string imageName, string imageMask) { //adds a custom icon to the face ResourceManager rm = new ResourceManager(typeof(OutlookUtilities).Namespace + ResourceImageFileName typeof(OutlookUtilities).Assembly); using (Bitmap bmp = (Bitmap) rm.GetObject(imageName)) { if (bmp != null) { button.Picture = AxHost2.GetIPictureDispFromPicture(bmp); } } using (Bitmap bmp = (Bitmap) rm.GetObject(imageMask)) { if (bmp != null) { button.Mask = AxHost2.GetIPictureDispFromPicture(bmp); } } } That bit of code should help you along. Regards, Thaddaeus. "donald" wrote in message oups.com... i going this in outlook 2003 trying with this code in a COM add-in for outlook 2003 but it doesn't work becuase it doesn't find the command LoadPicture. Any help please Donald Sub DisplayNewImage( ) Dim cbar As CommandBar Dim cbarctrl As CommandBarControl Dim pImage As IPictureDisp Dim pMask As IPictureDisp Dim sImageFile as String Dim sMaskFile as String sImageFile = "C:\Documents and Settings\My Documents\tarsier.bmp" sMaskFile = "C:\Documents and Settings\My Documents\mask.bmp" Set cbar = CommandBars.Add(Name:="My Picture", Position:=msoBarFloating) Set cbarctrl = cbar.Controls.Add(Type:=msoControlButton) Set pImage = stdole.StdFunctions.LoadPicture(sImageFile) Set pMask = stdole.StdFunctions.LoadPicture(sMaskFile) cbarctrl.Picture = pImage cbarctrl.Mask = pMask cbar.visible = True End Sub |
#6
|
|||
|
|||
![]()
hi there,
I don't want to do it with copy and paste i am using Outlook 2003. I want to do it using .picture and .mask. Any help please Donald |
#7
|
|||
|
|||
![]()
See if this helps: http://support.microsoft.com/?kbid=286460
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "donald" wrote in message oups.com... i going this in outlook 2003 trying with this code in a COM add-in for outlook 2003 but it doesn't work becuase it doesn't find the command LoadPicture. Any help please Donald Sub DisplayNewImage( ) Dim cbar As CommandBar Dim cbarctrl As CommandBarControl Dim pImage As IPictureDisp Dim pMask As IPictureDisp Dim sImageFile as String Dim sMaskFile as String sImageFile = "C:\Documents and Settings\My Documents\tarsier.bmp" sMaskFile = "C:\Documents and Settings\My Documents\mask.bmp" Set cbar = CommandBars.Add(Name:="My Picture", Position:=msoBarFloating) Set cbarctrl = cbar.Controls.Add(Type:=msoControlButton) Set pImage = stdole.StdFunctions.LoadPicture(sImageFile) Set pMask = stdole.StdFunctions.LoadPicture(sMaskFile) cbarctrl.Picture = pImage cbarctrl.Mask = pMask cbar.visible = True End Sub |
#8
|
|||
|
|||
![]()
i look at that page but i can't do:
Set oPic = LoadPicture(App.Path & "\circle.bmp") because I can't find 'LoadPicture' in VB.net as my project is a COM add-in for outlook 2003 thanks again Donald |
#9
|
|||
|
|||
![]()
Because you don't have a reference to the Win32 library where that method
lives or because of http://support.microsoft.com/kb/150034/? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "donald" wrote in message oups.com... i look at that page but i can't do: Set oPic = LoadPicture(App.Path & "\circle.bmp") because I can't find 'LoadPicture' in VB.net as my project is a COM add-in for outlook 2003 thanks again Donald |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom menu command | Melissa m | Outlook - Using Contacts | 1 | February 27th 06 08:27 PM |
Custom icon superseded by tracking icon | Vaughan | Outlook - Using Forms | 4 | February 24th 06 01:47 PM |
Outlook Shutdown - command line | Pete | Outlook - Installation | 1 | February 7th 06 09:28 PM |
Outlook command-line switches | Brad Nowlin | Outlook - General Queries | 1 | January 27th 06 06:00 PM |
Command button not working on read page | jbtempe | Outlook - Using Forms | 2 | January 14th 06 12:25 AM |