Add a Char in Slide

H

Harish Shinde

hi,

I have a custom commandbutton in VSTO. On click of this commandbutton I need to add a Char '@' to the current cursor location of the PowerPoint Slide.

Could anyone help me please :))

Thanks in Advance...

-Harish Shinde
 
S

Steve Rindsberg

hi,

I have a custom commandbutton in VSTO. On click of this
commandbutton I need to add a Char href="mailto:'@'"'@' to the current
cursor location of the PowerPoint Slide.

First, let's work on what you mean by the current cursor location; there isn't
really such a thing, at least not in the same sense that there's one in Word.

Instead, you'd work with the selection.

Sub InsertText()

' Is any text selected?
If ActiveWindow.Selection.Type = ppSelectionText Then
' note: ppSelectionText is a VB Long = 3
' that'd be a .Net Integer, I think

With ActiveWindow.Selection.TextRange
.InsertAfter "Your Text Here"
End With

End If

End Sub
 
H

Harish Shinde

Thanx Steve.. u helped me..

-Harish Shinde


Steve Rindsberg said:
First, let's work on what you mean by the current cursor location; there
isn't
really such a thing, at least not in the same sense that there's one in
Word.

Instead, you'd work with the selection.

Sub InsertText()

' Is any text selected?
If ActiveWindow.Selection.Type = ppSelectionText Then
' note: ppSelectionText is a VB Long = 3
' that'd be a .Net Integer, I think

With ActiveWindow.Selection.TextRange
.InsertAfter "Your Text Here"
End With

End If

End Sub

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

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