I was trying to programmatically insert some rich text into a specific text box in PowerPoint.
I had a rich text box in a winform application that had some formatted text. I wanted this to be moved into a specific textbox in my PPT.
The first approach I tried was to set the text directly:
But then the actual rich text markups were copied into the text. So the incoming data was getting interpreted as normal text. Makes sense..
So the next I tried was to copy the data from the richtext and then pasting it into the frame. When you do this manually, PowerPoint recognizes the format and pastes the data as formatted text.
Now I started getting a strange error – "The specified value is out of range." - when the Paste command executes.
After some changing of options and a search that did not yield any results, I suddenly thought, maybe if I force the clipboard type to be RTF then it may work. Yep it did.