1

I have the following original string: "This is the original sentence in Text Box". I make changes to the this text replacing "original sentence" by "new text" and adding the word "shape after the "Text Box". Now I have to markup and display all as one piece: enter image description here

Here is the code, but it does not produce desired results. //Create a color Color myForegroundColor = Color.Red; Color mtBlackColor = Color.Black;

                //Translate to an OLE color
                int redColor = ColorTranslator.ToOle(myForegroundColor);
                int blackColor = ColorTranslator.ToOle(myBlackColor);
                    for (int i = 0; i < diff.Count; i++)
                {
                    if (diff[i].operation == Operation.DELETE)
                    {
                        // This is for "original sentence"
                        PowerPoint.TextRange tr = allMarkupTextRange.InsertAfter(diff[i].text);
                        tr.Font.Color.RGB = redColor;
                        tr.Font.Underline = MsoTriState.msoFalse;
                        //allMarkupTextRange2.InsertAfter(diff[i].text).Font.Strikethrough = MsoTriState.msoTrue;

                    }
                    else if (diff[i].operation == Operation.INSERT)
                    {
                        // This is for "new text" and for "shape" parts
                        PowerPoint.TextRange tr = allMarkupTextRange.InsertAfter(diff[i].text);
                        tr.Font.Color.RGB = redColor;
                        tr.Font.Underline = MsoTriState.msoTrue;
                        

                    }
                    else
                    {
                        // This is for the rest
                        PowerPoint.TextRange tr = allMarkupTextRange.InsertAfter(diff[i].text);
                        tr.Font.Color.RGB = blackColor;
                        tr.Font.Underline = MsoTriState.msoFalse;
                    }


                }

EDIT: I am pretty much resolved my problems with this code. However, my main question that remains is: how to achieve Strikethrough font?

Leon
  • 165
  • 12

0 Answers0