L
Luut
Hey Shyam and Steve.
There's a little new bug. I want a failsafe built in as I
have in my other buttons. At first when the sub runs, it
checks whether a presentation is open. If so continue with
the sub. If not, end the sub. This failsafe I have
already. Your code works perfect as long as there is
something in the clipboard. I want to perfect it. The next
step is that the sub has to check if there's anything on
the clipboard. I tried several things but all give errors.
I suspect that it has to do something with .count. If
there's nothing there the a MsgBox will display "There's
nothing in the clipboard." But if there's something there
it has to check if it has text (.hasText) or it's
something else. In the case it's no text, the sub will
show an Msgbox "you can only paste text." And the sub will
end. If the clipboard contains text, then your code (.
pickup, paste, apply) will be executed and the sub ends.
So can you help me out with the code for checking if
there's something in the clipboard and checking if it
contains text. Here's the sub till so far. I removed all
my tryouts, you'd probably would laugh you ass of if you
saw them
----------
Sub PowerPointPasteSpecial()
OpenPresentatie = Application.Windows.Count
If OpenPresentatie >= 1 Then
If ActiveWindow.Selection.Type = ppSelectionText
Then
ActiveWindow.Selection.ShapeRange.PickUp
ActiveWindow.Selection.TextRange.Paste
ActiveWindow.Selection.ShapeRange.Apply
'ActiveWindow.Selection.Unselect
Else
MsgBox "U heeft geen tekst geselecteerd om de
inhoud van het clipboard mee te verwisselen.",
vbExclamation, "'Paste' als 'unformatted' text."
End If
Else
MsgBox "Er is geen presentatie open.",
vbExclamation, "'Paste' als 'unformatted' text."
End If
End Sub
There's a little new bug. I want a failsafe built in as I
have in my other buttons. At first when the sub runs, it
checks whether a presentation is open. If so continue with
the sub. If not, end the sub. This failsafe I have
already. Your code works perfect as long as there is
something in the clipboard. I want to perfect it. The next
step is that the sub has to check if there's anything on
the clipboard. I tried several things but all give errors.
I suspect that it has to do something with .count. If
there's nothing there the a MsgBox will display "There's
nothing in the clipboard." But if there's something there
it has to check if it has text (.hasText) or it's
something else. In the case it's no text, the sub will
show an Msgbox "you can only paste text." And the sub will
end. If the clipboard contains text, then your code (.
pickup, paste, apply) will be executed and the sub ends.
So can you help me out with the code for checking if
there's something in the clipboard and checking if it
contains text. Here's the sub till so far. I removed all
my tryouts, you'd probably would laugh you ass of if you
saw them
----------
Sub PowerPointPasteSpecial()
OpenPresentatie = Application.Windows.Count
If OpenPresentatie >= 1 Then
If ActiveWindow.Selection.Type = ppSelectionText
Then
ActiveWindow.Selection.ShapeRange.PickUp
ActiveWindow.Selection.TextRange.Paste
ActiveWindow.Selection.ShapeRange.Apply
'ActiveWindow.Selection.Unselect
Else
MsgBox "U heeft geen tekst geselecteerd om de
inhoud van het clipboard mee te verwisselen.",
vbExclamation, "'Paste' als 'unformatted' text."
End If
Else
MsgBox "Er is geen presentatie open.",
vbExclamation, "'Paste' als 'unformatted' text."
End If
End Sub