none
Font Scale combobox (or any other control that will do this) on the Ribbon? RRS feed

  • Question

  • Is there anyway of placing the "Font Scale" (from the "Character Spacing" of the Font Dialog box) directly onto the Ribbon through XML?

    I have a Template that makes great use of the Scale property in formatting the layout within the new document. It would be great if the ComboBox in the Font Dialog could be placed in the Ribbon itself (instead of pulling up the Font Dialog each time that I hi-lite text to change. I already have a Custom Tab that I link to other custom functions for the Template.

    I've searched for the idmso for it, but I'm not having any luck.

    Thank you in advance.

    Paul Goldstein


    Paul D. Goldstein Forceware Systems, Inc.

    Tuesday, November 27, 2012 4:37 AM

All replies

  • Hi Paul

    I don't find it listed, either... Closest I can find is FontSpacingNormal. And there are font spacing settings for WordArt.

    I think you'll have to roll your own and use a macro/code to assign the value.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, November 27, 2012 8:24 AM
    Moderator
  • Hi Cindy,

        I'm sorry that I didn't respond sooner. I got involved with another function in the Ribbon and has taken some time to solve. I took your advice and tried creating my own. I have an editBox that contains the scale value. I created two CallBacks for the editBox: 1) GetText 2) OnChange

        The OnChange works perfectly, I simply added: Selection.Font.Scaling = <my ByRef variable> and the selected text in my Document is rescaled just like the actual Dialog box would.

        The other side of the equation is why I'm writing (updating the editBox with the current FontScaling value). The GetText function, where the code is just the opposite (of the onChange call): <myByRef variable> which I call "txtFontScale" looks like:

    Sub subFontScaleGetText(control As IRibbonControl, ByRef txtFontScale)

      Debug.Print "In subFontScaleGetText"
      txtFontScale = Selection.Font.Scaling
     
    End Sub

    is only working when the Ribbon initially loads.

         I have created an Event to handle the Selection_OnChange and it is firing correctly. It calls a Sub that states: myRibbon.InvalidateControl("txtFontScale") which seems to have no effect.

         I have a few other controls on the Ribbon that are updated by myRibbon.Invalidate (usually they are buttons that are enabled/disabled based on other things going on in the Ribbon). They all seem to work correctly, but not the editBox's GetText function...it's only firing when the document is opened (and the Ribbon loaded).

        Any help would be greatly appreciated.

        Thanks,

        Paul Goldstein


    Paul D. Goldstein Forceware Systems, Inc.

    Wednesday, December 5, 2012 8:56 PM
  • You can take a look at Changing the value of an editBox office Ribbon Control at runtime .


    Regards,
    Fermin
    What's life without whimsy?

    Friday, December 7, 2012 6:35 AM