none
Making PowerPoint 2007 combobox right-to-left RRS feed

  • Question

  • I have a combobox which I have added programmatically to a PowerPoint slide. However, when viewed on an Eastern language system, both the control and the text within it are still left-to-right. I have tried at least changing the text to left-to-right using the following code:

    With ActivePresentation.Slides(1).Shapes("ComboBox").OLEFormat.Object
        .RightToLeft = RightToLeft.Yes

    I have also tried:

    shape.TextFrame.TextRange.ParagraphFormat.TextDirection = PpDirection.ppDirectionRightToLeft

    Neither of which have been successful. In the second case, the error says that the combobox shape does not have a TextFrame. Can anyone tell me how in C# or VB to set the ComboBox control to right-to-left?

    Thank you,

    Cindy

    • Edited by cwhitelm Monday, December 5, 2011 11:15 PM
    Monday, December 5, 2011 11:14 PM

Answers

  • Hi Cindy,

    Thanks for sharing your answers. You correct me with regard to the position of the drop-down arrow on the ComboBox control. In non-right-to-left locales the drop-down arrow button is on the right.

    I misnamed “notes” by calling them ‘comments.’

    You said
    “ the ComboBox controls, from what I can find, can only be added programmatically as an
    OLEObject.”

    You can drop it on a slide in PowerPoint 2007 and PowerPoint 2010 through the user interface from the graphic list of controls in the “Controls” group of the Developers Tab of the Ribbon. On the slide it will be an OLEObject. The group of controls also contains a TextBox. Both are ActiveX controls.

    Again, you should be able to either get an answer from the PowerPoint specialists a Microsoft Customer Support for PowerPoint, or get the Support Engineer to file a bug with PowerPoint Development. Please visit the below link to see the various paid support options that are available to connect you to Microsoft Customer Support.http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    If PowerPoint support can solve the problem that’s what you want, and you’ll be charged for the support incident. If the problem is a bug you won’t be charged for the incident.


     Please "…Mark as Answer" if my reply is helpful to you.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Regards,

    • Edited by cjatmsModerator Monday, December 12, 2011 4:52 PM
    • Marked as answer by cwhitelm Thursday, December 15, 2011 5:49 PM
    Monday, December 12, 2011 4:52 PM
    Moderator

All replies

  • Hi Cwhitelm,

    Thank you for posting.

    I did some reasearch about the problem but also found it difficult to set the combobox right-to-left. I looked into the properties of the object when debugging and can't find the property, I guess the OLEObject does not has the property for us to set.

    I will involve others to help you and see whether they can give you some suggestions, there might be some delay about the response. Appreciate your patience.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, December 7, 2011 3:46 AM
  • Hi Cindy,

    You answered the obvious question – is the System’s locale set to that of an Eastern country –Saudi Arabia etc.?

    On a system where the locale is that of an Eastern country if you experiment with using a TextBox (ActiveX control) does RightToLeft.Yes work correctly? You shouldn’t need to set that property, so setting the property may be self-defeating.

    Please let us know the results of running the simple test.

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Thursday, December 8, 2011 5:44 PM
    Moderator
  • When all of the System settings and the Microsoft language settings are set to the Eastern country, the PowerPoint presentation and all of it's controls show up as RightToLeft except the textboxes in the slides. If you click in a slide in the textbox that is automatically added in a slide layout (Title and Content) or if you add a textbox, the user must select the RightToLeft Text Direction button to change it.

    Thank you, Cindy

    Thursday, December 8, 2011 7:29 PM
  • Hi Cindy,

    Here are some questions about your last experiment

    1.       Did you create it through the user-interface of PowerPoint, not through use of code?

    2.       How do you get a button on the slide – if it is on the slide – to correct the orientation of the text in the textboxes, including the one for slide title

    3.       In your slide with the ComboBox, when you see the ComboBox in the slide, at which side is the Drop-Down arrow? In non-RightToLeft locales the button should be on the left, on Eastern locales the Drop-Down should be out of the way on the Right.

    4.       If a slide has comments are those displayed RightToLeft if the locale is Eastern?

    Please see the following MSDN information about the RightToLeft property behavior of ActiveX controls:

    Control.RightToLeft Property
    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.righttoleft(v=VS.71).aspx

    Where you’ll see this statement:
    “If the control is a top-level control, the user's operating system is queried to determine if the control needs to enable right-to-left support.”

    Also see the following about .NET:

    Control . RightToLeft Property
    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.righttoleft.aspx

    Where you’ll see this statement:

    ·         Items in list box, combo box, and up-down controls are right aligned.


    If you are into more background, for reference and background see:
    ContainingControl Property
    http://msdn.microsoft.com/en-us/library/system.windows.forms.axhost.containingcontrol.aspx

    According to the MSDN information cited above both the ComboBox and the TextBox controls conform to the bidirectional setting of the Windows System locale settings. But you’re not seeing that.

    By selecting the TextBox from the ActiveX controls in the “Controls” group on the Developer tab of the Ribbon I have built a slide with a TextBox control. If you have another technique please use that.

    If you build the slide through code and put a button on the slide that will change the text orientation that may be a solution to your issue – not that it’s what you planned.

    But, If your test shows the issue using a slide developed through the user interface rather than through code the problem shouldn’t be fixed by changing your code – the problem is in PowerPoint.

    In this case you should be able to either get an answer from the PowerPoint specialists a Microsoft Customer Support for PowerPoint, or get the Support Engineer to file a bug with PowerPoint Development.  Please visit the below link to see the various paid support options that are available to connect you to Microsoft Customer Support. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    If PowerPoint support can solve the problem that’s what you want, and you’ll be charged for the support incident. If the problem is a bug you won’t be charged for the incident.

    On the other hand if the problem is caused only when you programmatically place the ComboBox on the slide then you want to talk to the support engineers in the team for developer support for Office Products – named Visual Studio for Office Developers (VSOD). Again – if the engineer can solve your problem you’ll be charged for the incident, but if the issue is a bug he can report the bug and you will not be charged for the incident.

    Every browser of the Forum will want to know the answers to the 4 questions above, so please post those on a reply. Thanks,

    Please "…Mark as Answer" if my reply is helpful to you.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Friday, December 9, 2011 8:32 PM
    Moderator
  • Responses:

    1.        Did you create it through the user-interface of PowerPoint, not through use of code?

    Yes, the text boxes were being added through the user-interface.

     

    2.        How do you get a button on the slide – if it is on the slide – to correct the orientation of the text in the textboxes, including the one for slide title

    There is no button on the slide. The button I was speaking of was the RightToLeft button on the Paragraph section of the Home tab ribbon.

     

    3.        In your slide with the ComboBox, when you see the ComboBox in the slide, at which side is the Drop-Down arrow? In non-RightToLeft locales the button should be on the left, on Eastern locales the Drop-Down should be out of the way on the Right.

    In RightToLeft locales, the drop-down should be on the left. The ComboBox drop-down arrow is always on the right, even when the entire presentation has been set to RightToLeft.Yes.

     

    4.        If a slide has comments are those displayed RightToLeft if the locale is Eastern?

    Not sure what you mean by Comments. I set the property of the presentation as RightToLeft.Yes. Everything in the PowerPoint presentation shows RightToLeft when the presentation is displayed with the exception of the textbox text (which I can set) and the ComboBox (which I cannot set).

     

    Thank you, I had read these articles when researching the issue. While it is true that, with ActiveX controls, “both the ComboBox and the TextBox controls conform to the bidirectional setting of the Windows System locale settings”, the ComboBox controls, from what I can find, can only be added programmatically as an OLEObject. These objects do not expose the same properties that ActiveX controls do.

    Monday, December 12, 2011 2:30 PM
  • Hi Cindy,

    Thanks for sharing your answers. You correct me with regard to the position of the drop-down arrow on the ComboBox control. In non-right-to-left locales the drop-down arrow button is on the right.

    I misnamed “notes” by calling them ‘comments.’

    You said
    “ the ComboBox controls, from what I can find, can only be added programmatically as an
    OLEObject.”

    You can drop it on a slide in PowerPoint 2007 and PowerPoint 2010 through the user interface from the graphic list of controls in the “Controls” group of the Developers Tab of the Ribbon. On the slide it will be an OLEObject. The group of controls also contains a TextBox. Both are ActiveX controls.

    Again, you should be able to either get an answer from the PowerPoint specialists a Microsoft Customer Support for PowerPoint, or get the Support Engineer to file a bug with PowerPoint Development. Please visit the below link to see the various paid support options that are available to connect you to Microsoft Customer Support.http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    If PowerPoint support can solve the problem that’s what you want, and you’ll be charged for the support incident. If the problem is a bug you won’t be charged for the incident.


     Please "…Mark as Answer" if my reply is helpful to you.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Regards,

    • Edited by cjatmsModerator Monday, December 12, 2011 4:52 PM
    • Marked as answer by cwhitelm Thursday, December 15, 2011 5:49 PM
    Monday, December 12, 2011 4:52 PM
    Moderator