Dim fileName As String = "D:\\demo1.ppt" Dim pres As Presentation = New Presentation(fileName) Dim slides As Slides = pres.Slides Dim pholders As Placeholders = slides(0).Placeholders Dim th As TextHolder = pholders(0)
th.Paragraphs(0).Portions(0).Text = "Hello World" Response.ContentType = "application/vnd.ms-powerpoint" Response.AppendHeader("Content-Disposition", "attachment; filename=demoppt.ppt") Response.Flush() Dim st As System.IO.Stream = Me.Response.OutputStream Dim slide2 As Slide = slides(0) Dim shape2 As Shape = slide2.Shapes.AddTable(10, 10, 5000, 3000, 5, 3)
Now i get a table in the slide as shown in attachment-1. But i don't know how to show text in each of the cell in the table. Pl advise what code i should be using.
I tried using the below code which did not work
shape2.AddTextFrame("Cell1")
2. Also does your component support Html as input for the export to Powerpoint i.e. i want to export HTML Data to my .ppt file.
HTML export is not supported. You should do it by yourself.
Dim shape2 As Table = slide2.Shapes.AddTable(10,10,5000,3000,5,3) Dim tfName As TextFrame = shape2.GetCell(0, 0).TextFrame If Not tfName Is Nothing Then tfName.Paragraphs(0).Portions(0).Text = “Cell1” End If
Please check sources of our Aspose.PowerPoint.Northwind demo. It shows most of available features.
1. Is there a way to set the fontsize for all text in a slide/presentation. I was able to set the font for the presentation with :
pres.Fonts(0).FontName = "Tahoma"
2. I am getting a distorted output for the text in the cells of the table as shown in the attached image. Pl advise how it can be made to look presentable.
You should set fontsize for each portion of text separately. 2. Automatic table resizing to fit text is not supported yet. Estimated release date is end of September. Changing height of rows in a table is available.