Programmtically insert text at the cursor on a slide?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I programmatically insert text onto a slide where the cursor is
currently set at? I have a toolbar with a combo box and a button and when
they click the button I want to insert the text in the combo box onto the
current slide whereever the cursor is currently set to?

Thanks

Scott
 
You can't just drop text on the slide, it must reside in either a PPT object
or a VBA control.

Austin Myers
MS PowerPoint MVP Team

Solutions to Multimedia in PowerPoint www.pfcmedia.com
 
Right..I understand that part. What I want to be able to do is be able to
programmatically determine what shape/object the cursor is in and insert text
at that location when they click my button on the command bar i created.

Thanks

Scott
 
Right..I understand that part. What I want to be able to do is be able to
programmatically determine what shape/object the cursor is in and insert text
at that location when they click my button on the command bar i created.


' This calls the subroutine below
Sub TestInsertText()
InsertText "Hi there. I'm your text. Insert me."
End Sub

' This does the actual work and is what you'd call from
' your own code:
Sub InsertText(sText As String)
With ActiveWindow.Selection
If .Type = ppSelectionText Then
.TextRange.Text = sText
Else
MsgBox "Select some text and try again. Thanks ever so much."
End If
End With
End Sub
 
Back
Top