Most programs allow you to copy the selected the Text. for this reason, you should use SelText instead.
Code:Clipboard.SetText Text1.SelText
Printable View
Most programs allow you to copy the selected the Text. for this reason, you should use SelText instead.
Code:Clipboard.SetText Text1.SelText
You should clear the Clipboard first.
Code:Clipboard.Clear
Clipboard.SetText Text1.SelText
The clipbaord is already cleared once you add something so really don't need to clear it.
Megatron, Crazy VIII said he wanted to copy a textbox to the clipboard, not the selected text.
Using SelText will copy the seleted text (if any), however, if no text is selected, then this will copy the whole text.
[Edited by Megatron on 09-09-2000 at 01:18 PM]Code:If Text1.SelText = "" Then
Clipboard.SetText Text1
Else
Clipboard.SetText Text1.SelText
End If
I know that. But he wants the whole textbox copied.
Have it your way.
My way's shorter though.Code:Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Clipboard.SetText Text1.SelText
But almost twice as slow.
Nope, not really! You don't actually have to clear the clipboard when you're using text, but try to put a picture on the clipboard without clearing it first!Quote:
Originally posted by Megatron
The clipbaord is already cleared once you add something so really don't need to clear it.
That is why I always recommend clearing the Clipboard object before putting anything in it.