Add a Char in Slide

  • Thread starter Thread starter Harish Shinde
  • Start date Start date
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
 
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
 
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
================================================
 
Back
Top