Insert Text

T

technoknight

I m working on VC++ regarding Automation of Powerpoint. I have to first get
text imput fromuser and then put that text into powerpoint slide. I have
been able to get the user input string...which i have stored in a CString
type variable called msg.
Here is my code to regarding the insertion of text inot powerpoint slide:

// Connect to the active presentation object.
_Presentation ActivePresentation(app.GetActivePresentation());

// Connect to the Slides collection object.
Slides oSlides(ActivePresentation.GetSlides());

// Connect to the first slide in the presentation.
long lIndex=1;
COleVariant SlideNumber(lIndex);
_Slide oSlide(oSlides.Item(SlideNumber));

//Connect to the shapes collection
Shapes oShape(oSlide.GetShapes());

I know after this i have to access the TextFrame, then the TextRange & then
the Text Object. But I cannot understand how to do that.

I got this idea from another post there it was given in VB. The Code was:

Sub AddTextToMyShape()

' Watch linebreaks; this should be on one line
ActivePresentation.Slides(1).Shapes("MyShape").TextFrame.TextRange.Text = "You
found me!"

End Sub


Can somebody help me further in my code.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top