Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Fri May 06, 2016 12:43 pm

What is the VB code to:
1. Break line within a slide textbox after last text character?
2. Insert additional text within this textbox after linebreak?

10Q!

kdr13
 
Posts: 72
Joined: Fri Apr 15, 2016 4:35 pm

Mon May 09, 2016 9:43 am

Hello,

Thanks for your inquiry.
The below code for your reference:
Code: Select all
Dim p As New Presentation()
p.LoadFromFile("..\..\1.pptx")
Dim shape As IAutoShape = TryCast(p.Slides(0).Shapes(0), IAutoShape)
Dim count As Integer = shape.TextFrame.Paragraphs.Count
Dim origianltext As String = shape.TextFrame.Paragraphs(count - 1).Text
Dim addedText As String = "hello world"
Dim newText As String = Convert.ToString(origianltext & Convert.ToString(vbLf)) & addedText
shape.TextFrame.Paragraphs(count - 1).Text = newText
p.SaveToFile("1.pptx", FileFormat.Pptx2010)


Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Tue May 10, 2016 7:09 am

Hi,

Did the code work for your scenario?
Thank you for your feedback in advance.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri May 13, 2016 6:33 am

Thank you...I was able to implement the required functionality with some changes of the code provided.

Thank you!

kdr13
 
Posts: 72
Joined: Fri Apr 15, 2016 4:35 pm

Return to Spire.Presentation