|
-
Apr 3rd, 2000, 06:56 PM
#1
Thread Starter
Conquistador
how do i get the selected text, in the active window,
also how do i get all the text in the active window.
any help would be appreciated
-
Apr 3rd, 2000, 11:17 PM
#2
Addicted Member
if the text were in a text box:
'First clear the clipboard
Clipboard.Clear
'Select Text in txtBox & copy to clipboard
Clipboard.SetText txtBox.Text, vbCFText
'''''''''''''''''''''''''''''''''''''''''''
to paste it back or to another text box
txtBox.Text = Clipboard.GetText
-
Apr 4th, 2000, 12:26 AM
#3
Member
If you are talking about an mdi interface then:
'on the main form
str_myVariable = Me.ActiveForm.rtfText.seltext
'for all the text
str_myVariable = mid(Me.ActiveForm.rtfText.text,1,len(Me.ActiveForm.rtfText.text))
-
Apr 4th, 2000, 01:50 PM
#4
Thread Starter
Conquistador
Sorry, I should have been more specific
Sorry, I should have been more specific
I know how to do all of that,
but what I was after is the selected text, in an application that is not "mine". Say if in microsoft word, they used a hot key, to activate my program, it would show the selected text in the active window (i.e. Microsoft Word)
-
Apr 4th, 2000, 02:09 PM
#5
Fanatic Member
Do an activate on whatever window using "Appactivate".
Then use (not sure about the syntax - you can look up in help):
Sendkeys "^{C}",True
Make sure uppercase "C".
Basically copy to clipboard.
Guarantee to work!!!
Chemically Formulated As:
Dr. Nitro
-
Apr 4th, 2000, 06:07 PM
#6
Thread Starter
Conquistador
not what i would've liked, that was the last solution i had wanted but ehh...
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|