Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I add text in a ppt? 1

Status
Not open for further replies.

iscariot

Mechanical
Oct 15, 2009
154
DE
I found how add Picture inside a ppt in below thread:
[link ]
[/url]

But I would need also to add a text from a catscript. How can I do this? I tried like below but it does not work:
Code:
ppt.ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 50).TextFrame.TextRange.Text = "Test Box"


Thank you.
 
Replies continue below

Recommended for you

You are right, I could do it like you told but it is not exactly what I need. Off course, if no other way than I will proceed as you told.
I would need more control on the ppt in order to make it automatically using the company standard to be sent to our customer.
I want to make it a little bit more complex, with more functionality, but I was stuck just from the beginning with adding a simple text :)
Should be possible to add a text in a ppt using a catscript?

 
Is this what you want?


Untitled_uikdyc.png


if it is:

Code:
PPT = PPT.ActivePresentation
            Dim SlidesCount = PPT.Slides.Count
            Dim oSlide = PPT.Slides.Add(SlidesCount + 1, Powerpoint.PpSlideLayout.ppLayoutTitleOnly)
            With oSlide.Shapes.Item(1).TextFrame.TextRange
                .Text = TextBox1.Text' this is the string that adds the text
                .Font.Name = "Eurostile LT (Headings)"
                .Font.Size = 48
            End With

Tiago Figueiredo
Tooling Engineer
 
Thank you TiagoFigueiredo, this was exactly what I was looking for :) .

I updated the intial code with below code inside a catscript:

Code:
	uNewS.Layout = 4 '12 means no text / 4 means title only


Code:
        With uNewS.Shapes.Item(1).TextFrame.TextRange
            .Text = AnnViewName 'this is the string that adds the text
            .Font.Name = "Eurostile LT (Headings)"
            .Font.Size = 48
        End With
 
Now I need your help. One of my collegues is trying to do this for NX. wich is very simillar to CATscript.
How do you call PowerPoint?

Tiago Figueiredo
Tooling Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top