Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Word 2010 Ribbon XML - Add Watermark and Picture Compress options

Posted on 2014-01-23
5
Medium Priority
?
962 Views
Last Modified: 2014-01-28
Hi Super Gurus

I have created special ribbon buttons for my client and the two options that I can't work out how to add to my ribbon is the Watermark option (Page Layout, Watermark) and Picture Compress dialog box.  I have attached three images of what I'm referring to.

I used the Customise Ribbon option and dragged these two options into a new group and they worked fine.  I then used 'Export all customizations' to save those settings into a "Word Customizations.exportedUI" file so that I could see what code was generated.  The code that it constructed for those two options are:

<mso:control idQ="mso:PicturesCompress" />
<mso:gallery idQ="mso:WatermarkGallery" />

I can't work out how to use this in my xml code so that when the user clicks those options they run in the same way as they should in Word.

For example, here is xml code that I have for the watermark command:

<button id="btnWatermarkGallery" label="Show/Hide DRAFT watermark" screentip="Show/Hide DRAFT watermark" onAction="MenuButtonOnAction"  />

How do I incorporate the information <mso:gallery idQ="mso:WatermarkGallery" /> into my existing code?  Do I still need to use OnAction?  I was hoping that Word would know what inbuilt command to run when these options were selected by the user and would not need me to specify anything within the MenuButtonOnAction statement.

Also advice on how to use the PicturesCompress command in the xml code would be really appreciated.  I noticed that one is a control idQ and the other was a gallery idQ so not sure what to do with that information.

Thank you so much ...

HJ
Watermark-button.jpg
Compress-Pictures.jpg
Compress-Pictures-Button.jpg
0
Comment
Question by:hj_daisy
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 39805258
Hi there,

Change your id to "PicturesCompress". You can't assign a unique id to a built-in control you're using, and you can't define an onAction for it either. So if you want a button to perform the native functionality your XML should read:
<button idMso="PicturesCompress"/>

Open in new window


But if you wanted your own routine to run from the callback but you wanted that image, you could use the "imageMso" property:
<button id="btnWatermarkGallery" imageMso="PicturesCompress" label="Show/Hide DRAFT watermark" screentip="Show/Hide DRAFT watermark" onAction="MenuButtonOnAction"  />

Open in new window


I don't know how the built-in functionality of these controls works, but there's no way we can optimize it, especially in VBA, since it's compiled in C#, a much faster language than VBA.

HTH

Regards,
Zack Barresse
0
 

Author Comment

by:hj_daisy
ID: 39805378
Hi Zack

Thank you so much for your advice.  The PicturesCompress worked perfectly and the dialog box appears on the screen when that option is clicked.

I had trouble with the WatermarkGallery code.  I don't want any macro routine to run from my template but to just show the user the Watermark dropdown panel appear OR have the watermark dialog box display for the user.  My preference is for the watermark dialog box to appear on the screen.

I've attached images of both these situations.

Being a 'gallery' image and not a 'control' image, I'm not sure how to write that in the xml code and I tried a few things but no luck.

Thanks for any advice...

regards
HJ
Watermark-dialog-box.jpg
Watermark-gallery-list.jpg
0
 
LVL 14

Accepted Solution

by:
Zack Barresse earned 2000 total points
ID: 39805391
Yeah, you'd need to call the idMso of that gallery, so your XML to use the built-in gallery would be this...

<gallery idMso="WatermarkGallery" size="large"/>

Open in new window


You can place this anywhere in your custom ribbon and it'll be the same as the native functionality.

HTH

Zack
0
 

Author Comment

by:hj_daisy
ID: 39816607
Works brilliantly.... thank you so much.  It seems so simple, I can't believe I struggled with such a little command.

Thank Zack....


regards
HJ
0
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 39816610
Welcome to XML. The simplest and most confusing language conceived - ever. LOL! There's no good IDE for it either, so it's almost always created in a text editor.

Glad to be of help.

Take care,
Zack
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
Quickbooks hosting can do wonders to your enterprise but considering the points elaborated in the article which will help you to better analyze the outcomes. So scan your business, its needs and then move to the new world of limitless benefits.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question