0

I've a requirement to export ppt from C# without using introp dlls. I am able to do that but when I do append some HTML string i.e. "<b>Krishna</b><br/><strong>Ram</strong>" in any slide, it is showing the same text, not rendered one. Can any help me ?

4
  • 2
    What is export PPT means here? Are u creating PPT (MS Office) through c# without interops? Commented May 9, 2012 at 11:55
  • 1
    Hard to understand. HTML encoding in a PowerPoint? Commented May 9, 2012 at 12:22
  • Sorry for the confusion. I've a master powerpoint file, I am opening that file into C# and adding images , text into that and writing using MemoryStream on the memory for user. Now when I am adding such text, so the text is being append in the same html tag format. Commented May 9, 2012 at 12:24
  • if I've <b> Bold</b> can it look in ppt as Bold Commented May 9, 2012 at 12:27

1 Answer 1

1

It appears that PPT does not currently support HTML rendering directly in PPT. You must either export your slide show as HTML, or use the built in formatting as shown in answer to the following question: Apply Font Formatting to PowerPoint Text Programatically.

Set tr = ActiveWindow.Selection.SlideRange.Shapes(1).TextFrame.TextRange
        With tr
            .Text = "Hi There Buddy!"
            .Words(1).Font.Bold = msoTrue

For an idea of the settings in C# and Office 2010 specifically see Font Members.

You should be able to test my assertion yourself, by HTML encoding your text using the HttpServerUtility.HtmlEncode Method:

String TestString = "This is a <Test String>.";

String EncodedString = Server.HtmlEncode(TestString);

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.