Ribbon. Does the Image attribute allow loading from file?

A

Andrei Smolin

Hi,

In the Ribbon schema (http://officeblogs.net/UI/customUI.zip) the image
attribute is of the ST_Uri type, which is described as "A string argument
for a path to a file or a resource." However, when I specify the path to an
image file in the image attribute I get the "No loadImage callback was
specified to load the image ..." error message. My XML follows below.

===
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<officeMenu>
<menu id="MyMenu" label="My Menu" image="file:///c:\myimage.bmp">
<button label="My Button" id="MyButton" onAction="MyAction"/>
</menu>
</officeMenu>
</ribbon>
</customUI>
===

I tried also "file://c:/myimage.bmp", "file://c:\myimage.bmp",
"file:///c:\myimage.bmp". No success. Can you tell me if it is possible to
display an image in this way?

Regards From Belarus,

Andrei Smolin
Add-in Express Team Leader
 
P

Patrick Schmid [MVP]

Hi Andrei,

This won't work. Are you working on a COM add-in or a VBA solution?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
K

Ken Slovak - [MVP - Outlook]

No file path and no file extension: image = myImage

The file must be a compatible file type such as BMP or PNG and it must be
located in the folder where the executing assembly is located.

getImage is much more flexible as a callback because in the callback you can
specify a path and anything else for the image file, but of course then you
must supply an IPictureDisp object back as the return of the getImage
callback.
 
A

Andrei Smolin

Hi Ken & Patrick,

Thank you for your answers.

I'm trying to show an image in a menu shared by several COM Add-ins. The
shared namespace is an arbitrary string (not a ProgId), so the callbacks
will be neither called nor processed.

In our Add-in Express product line, we are implementing the "sharing Ribbon
container controls" functionality for our Ribbon components. There is no
problem to share a Ribbon tab, group, box, and buttonGroup using a
non-inhabited namespace. However, the impossibilty to show an image for an
Office 2007 menu shared in such a manner just gets us stuck. This is a
feature most developers will want and we don't like to explain to them that
"it is the way the Ribbon works". However, if this approach doesn't really
work, I can see no ways out of the situation. Can you suggest any?

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com

Patrick Schmid said:
Hi Andrei,

This won't work. Are you working on a COM add-in or a VBA solution?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




Hi,

In the Ribbon schema (http://officeblogs.net/UI/customUI.zip) the image
attribute is of the ST_Uri type, which is described as "A string argument
for a path to a file or a resource." However, when I specify the path to
an
image file in the image attribute I get the "No loadImage callback was
specified to load the image ..." error message. My XML follows below.

===
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<officeMenu>
<menu id="MyMenu" label="My Menu" image="file:///c:\myimage.bmp">
<button label="My Button" id="MyButton" onAction="MyAction"/>
</menu>
</officeMenu>
</ribbon>
</customUI>
===

I tried also "file://c:/myimage.bmp", "file://c:\myimage.bmp",
"file:///c:\myimage.bmp". No success. Can you tell me if it is possible
to
display an image in this way?

Regards From Belarus,

Andrei Smolin
Add-in Express Team Leader
 
K

Ken Slovak - [MVP - Outlook]

Patrick may know of something else but my answer would be "that's the way
the ribbon works".

I just use loadImage in my ribbon code and have shared images that way, the
images are either resources in the project or files in the installation
folder, depending on whether I'm writing the code in VB.NET/C# or VB 6.
 
K

kvrtech

I am trying to the same, but i could'nt..
are you able to do that, let me know if you have any success.

Thanks
 
P

Patrick Schmid [MVP]

Have you read Ken's suggestion? That should give you the answer you
need.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 

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