none
how to type text above math symbol? RRS feed

  • Question

  • hi every one,

    I want to say thank you for every one helps me in my Arabic Equation Project. I want to know how to insert a text above math symbols like summation. I tried this code

     Document vstoDocument = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
                Word.Range wdFunctionR = Globals.ThisAddIn.Application.Selection.Range;
                Word.Selection selection = Globals.ThisAddIn.Application.Selection;
                Word.Range rng = Globals.ThisAddIn.Application.Selection.Paragraphs[1].Range;
               
                rng.Font.Size = 14;
                rng.Font.Name = "Arial";
              
          wdFunctionR.Application.Selection.TypeText("\u01B7"); /// summation symbol in arabic Language.
                wdFunctionR.Application.Selection.Font.SizeBi = 8;
                wdFunctionR.Application.Selection.Font.Superscript = 1;
                wdFunctionR.Application.Selection.TypeText(" a");
                wdFunctionR.Application.Selection.TypeText(" ");
                wdFunctionR.Application.Selection.Font.Subscript = 0;
                wdFunctionR.Application.Selection.Font.Subscript = 1;
                wdFunctionR.Application.Selection.TypeText(" b");
                wdFunctionR.Application.Selection.TypeText(" ");
                wdFunctionR.Application.Selection.Font.Subscript = 0;
                wdFunctionR.Application.Selection.TypeText(" ");
                wdFunctionR.Application.Selection.Font.Reset();

    I want the "a" character to be above the symol. and the "b" to be under the symbol.

    how can I do it??

    thanx alot.

    Saturday, October 13, 2012 3:17 PM

All replies

  • Hi,

    Thanks for posting in the MSDN Forum.

    According to your description of " want the "a" character to be above the symbol. and the "b" to be under the symbol", I assume that your objective is to get the text "a + b" vertical. I would suggest you use the Range.Orientation Property like this

    range.Orientation = Word.WdTextOrientation.wdTextOrientationVerticalFarEast;
    

    Hope it helps.

    If I misunderstand you, please feel free to let me know.

    Best Regards,


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    Monday, October 15, 2012 7:08 AM
    Moderator
  • Thanks for your answer but it doesn't work as what I want. I want the "a" character to be as aboveScript and the "b" character to be underScript. Could I do that?

    thanx.

    Tuesday, October 16, 2012 4:40 AM
  • Hi,

    I will involve some experts who are familiar with this issue, and it may take some time. Much appreciate for your patience.

    Best Regards,


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, October 19, 2012 2:37 AM
    Moderator
  • thanx alot. I'm waiting :)
    Sunday, October 21, 2012 3:43 AM
  • Hi,

    Please refer to forum http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/a32c4714-f2d7-458c-a31f-696f6de64a0a which has the code to display summation symbol with aboveScript and underScript characters.

    Thanks,


    Shiv Khare

    Monday, November 5, 2012 4:19 PM
    Moderator
  • thank you. I know this link but it doesn't work right in arabic symbol.

    anyway I solved my problem by using

     wdFunctionR.Application.Selection.Font.Subscript

    and

    wdFunctionR.Application.Selection.Font.Superscript

    thanx

    Saturday, November 10, 2012 10:17 AM