none
powerpoint vba change font of non-english textbox RRS feed

  • General discussion

  • Plz consider the following code

    Sub test() 
        Dim sldNewSlide  As Slide 
        Dim shpCurrShape As Shape 
        With ActivePresentation 
            Set sldNewSlide = .Slides.Add(.Slides.Count + 1, ppLayoutBlank) 
            With sldNewSlide 
                Set shpCurrShape = .Shapes.AddTextbox(msoTextOrientationHorizontal, 25, 50, 50, 200) 'left top width height
                             
                With shpCurrShape 
                    With .TextFrame.TextRange 
                         
                         '------------ Below is an ARABIC string
                        .Text = ChrW$(&H6A9) & ChrW$(&H64A) & ChrW$(&H641) & " " & ChrW$(&H62D) & ChrW$(&H627) & ChrW$(&H644) & ChrW$(&H643) 
                         
                        With .Font 
                            .Name = "Arial Unicode MS" ' or "Traditional Arabic" -------------- THIS LINE IS NOT WORKING
                            .Size = 65 
                        End With 
                         
                    End With 
                End With 
                 
            End With 
        End With 
    End Sub
    As indicated above, the font of arabic text is not being changed. Font change works well when the textbox contains english text. In case there is mixed arabic & english text, the english font is changed but arabic text stays in the default font (i.e Arial).

    This code was working fine in Office 2003, but I came across this problem when trying to run in Office 2007/2010.

    Although I have tested with arabic script languages only (arabic/urdu/persian etc), but I guess this problem will come up when dealing with any non-latin-script language.

    How can I make it to work. Any suggestions?



    • Changed type Ammar H Thursday, November 29, 2012 5:46 AM no one is answering
    • Edited by Ammar H Friday, November 30, 2012 11:17 AM
    Wednesday, November 28, 2012 2:53 AM

All replies