Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Copy Text From Textbox Of Other Application

Hi Guru's,

I would like to know which approach is best in solving this problem.

Situation: One application running (NonVBApp) has buttons and a textbox which is updated often with downloaded info (like chat). This is a commercial application. My program (MyVBApp) should 1) read what's in that textbox , then 2) analyse the content of the text and 3) perform actions accordingly (pushing buttons) of NonVBApp.

- first i tried to directly tap into the port NonVBApp is using to get it's data over the net, in the hope of extracting the text from there. This seems to be impossible in VB (and using a 3rd party Packet Sniffer does not feed the info to my program continuesly).
- second i tried to use the clipboard to - manually - copy text from the textbox to MyVBApp. This works only from time to time (cursor blinks in textbos, but ctrl-A fails me). More-over, automating this proces is what the program should be about

Can I somehow extract text from a textbox of another application?

Any other suggestions?


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Copy Text From A Textbox To Another Application Like Word Or Excel.
I would like to know how to copy all the text from a textbox without
having to highlight it first and then doing a right click to copy. I just want
to click into the textbox, and then right click again in another application like Word or Excel to paste it in. Is this done with a mouse-down event or

Grab/Copy From A Textbox In Another Application

This is my problem:
I have an MS Access.exe (2002) innstalled on my pc. I am NOT the owner of this program so I dont have access to to the db.

I would like to make a program in vb6 that allowes me to get the text of a specific textbox in a specific form in the MS Access program. When the Spesific form is open.

I have the name of the textbox but cant locate it and copy it's contents. this might be because the textbox I am trying to find is not enabled. Meaning I cant click on it and ctrl/c.

Pls reply with code samples. or any other ways to do this.
I wish I could do this. " label1 = other_applications_form_name.text1.text" lol

Copy Text From 1 Textbox To Another
Hi all

Please can some-one help me with the following, the code below copies the text from within one textbox to another textbox. The code works but only for the first textbox there after nothing happens. This is what I am trying to do I have three textboxes
txtCash, TxtCardAmount and txtCheque , only one of those textboxes gets an amount put in at a time, the command button copies the text into the Txtpayment textbox. But it only works for the first line of code.

TxtPayment.Text = TxtCash.text
TxtPayment.Text = TxtCardAmount.text
TxtPayment.Text = TxtCheque.text

Kind Regards.

Copy Text From Another Application
I need to get text from specific text boxes in another application. I have not control over the other application and want to be able to copy the text from some of the text boxes for use in processing in my application.

Any help? I can get the text from all of the text boxes by enumerating the child window in the form, but I only need information from 2 text boxes and need to know how to identify those 2 text boxes.



Copy Text From Another Application.
I am trying to put the contents from a non-vb program onto the clipboard.

It is text, but it is formated with different colors and bolding/italic's, etc.

I would like to get the formating and everything onto the clipboard, but im not sure how.

I've been messing around with SendMessage, but can't get that to work.
I've used the constants:
Public Const WM_COPYDATA As Long = &H4A
Public Const WM_CUT As Long = &H300
Public Const WM_COPY As Long = &H301

but I am either not using them correctly, or they just don't work.

I'd use like:
SendMessage Hwnd, WM_..., 0&, 0&
And alternating, the first "0&" would be then length of the text in the textbox.

Any ideas?

Is That Possible To Copy From Any Text Of Listview To Textbox
I'm using listview on the Userform with textbox
is that possible when I click on any text of any columns of Listview it will copy to texbox.

How Can I Select All Text And Copy It In A Textbox
I am a newbie ti VB, and I need to know how to hit a button that would select all text in a given textbox, and then hit another button to copy it.



Copy Text In A Textbox To Clipboard
I have a Text box And I need a code for a copy to clipboard command of the text in the textbox currently(It's on a calculater that I cant just select the text) Any idea's

Textbox:SelectAll,Copy,Paste Text Into New .txt
i have a textbox and i would like to have 2 controls/buttons for it.

button1: i want the 'select all' text in the textbox and copy it.
button2: i want to open a new textfile(notepad) and paste the text there.

i need the working code for this and any necessary references, thanks!

and oh one more thing,
i know this post is not relevent to my next question but i'll give it a try:

how do i migrate a MSWord macro to another pc with an older MSWord version?

thanks again!

I Want Copy Multiline Text To A Single Line Textbox
i have a textbox and a comboBox in a form.
and the textbox's Multiline propty is false.
when user copy Multiline text into it twice or more ,something unusual happened.
comboBox can't display list and memery is not enough happened.
the Attach Files is the code.
someone can help me?thanks

Using Windows Clipboard To Copy Text From Textbox - Resolved
Hi guys, this is a great forum site and I hope I'm not putting my question in the wrong place.

I have a problem with an application I am making - part of it uses the Windows Clipboard to copy items for use externally. Here is the code.


Private Sub cmdCopy_Click()

If txtInput.text = "" Then

MsgBox "There's nothing to copy to the clipboard."


txtInput.SelStart = 0
txtInput.SelLength = Len(txtInput.text)

Clipboard.SetText txtInput.SelText

End If

End Sub

If I test the application when I run it in Visual Basic, it works. I can clear the text box using a Clear button, type again and each time I click cmdCopy, the text is copied to the clipboard.

But when I make a *.exe of the application and run it, I can only copy once and then it doesn't work anymore, Clipboard only pastes whatever was copied first, and cmdCopy doesn't **appear** to be working.

My thanks in advance for anyone who is able to help me with this problem, and apologies again to the moderators if I have asked this in the wrong place. -_-

How To Copy Text From A Textbox && Save It To New .html File?
I would like to know how I could copy the text out of a text box and save it to a file.

If possible save it to a directory I can specify and the extension would be .htm.

Is this possible?

Thanks for any examples or code

TextBox.Text Changed By Application Or User

I have a situation where I would prefer to know if a particular TextBox.Text is changed by the application or by a user. Is there any way to find this out?

Cuz right now even when the application assigns a value to a textbox.text the procedure textbox_changed() gets excecuted. I want to know just when a user typed something in the textbox.text and changes the value.

Any and all HELP or suggestions are greatly appreciated.

Copy All Text From Textbox, Open Notepad, And Automatically Paste To New Notepad Shee
Hello everyone.

I am trying to copy all text, that is already in the textbox, to a new notepad sheet.


Step 1. Copy all text in Text1 box to clipboard.
Step 2. Open Notepad
Step 3. Paste clipboard to notepad.

All this should be done with one click of a button.

I get as far as copying everything to the clipboard, and it even opens up notepad, but I still have to manually paste (CTRL-V) into notepad.

I would even like it to ask me what name to save it as as well as where to save it at...just like the Save As function in Word or something.

Here is what I have so far.

Private Sub cmdCopytoClipboard_Click()
Dim MyAppID
Clipboard.SetText Text1.Text
MyAppID = Shell("NOTEPAD.EXE", 1)
AppActivate MyAppID
MyAppID = Clipboard.GetText()

End Sub

Copy First 5 Words Of Textbox Into Another Textbox

I need help again. I am trying to get the code to be able to read the first 5 words from a text box and copy them into another textbox.

Please help



How Do I Copy From One Textbox To Another?
Hi eveyone!

How do I programm a command button to copy the text from a text box and paste it in another textbox?



Copy Without Textbox
What I'm going for is when you click this button It will copy this number to the clipboard and start another program.
Private Sub Command1_Click()
Clipboard.SetText "1045-1209-6738-4668-7696-2783"
Shell "Test.exe"
End Sub

Thanks for your help

Copy From Textbox
I am trying to make a word processor, and I can open an open file, and a save file dialog now, but I can copy to a clipboard.

here is my code I thought would work...

VB Code:

Sir Loin

Copy From Textbox
whenever i copy something from a text box, (by highlighting it and pressing ctrl+c) it will copy the text to my clipboard, but it will never let me copy it twice, it try closing the app and opening it again, and it still won't let me copy it to clipboard. Any help?

Copy More Than 1 Textbox.
I am trying to copy more than 1 textbox i.e.
I have
4 textboxes in 1 row in a form and
4 textboxes in the next row and
4 textboxes in the row after that.
I want to copy the textboxes to excel so that the first row will be shown in cell
A1,B1,C1,D1 the next row in
A2,B2,C2,D2 and the next row in
This is what i've got and does not work
Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
Dim objcontrol As Object
Dim strtext As String

objcontrol = Nothing

strtext = objcontrol.text

If TypeOf objcontrol Is TextBox Then


End If

End Sub
What am I doing wrong. Any suggestions?

Copy Application
I have a very large application which I need to copy and paste then rename. I have tried this in the past and have not had much luck in changing the name and having the new name shown after the compile.
This may not be very clear.
For example I have application "one" and compile it to one.exe, I want to copy this application and rename the copy to application "two" then make my changes and when I compile it I want it to compile to two.exe.
I would think this must be easy but have been unable to figure it out or find a similar posting in this database.

Copy Contents Of Textbox
hello there, have a slight problem, which i have stumbled accross.

what i have is a textbox, and a command button. when you click the command button, what i want it to do is copy all the contents from the textbox.

thats it im affraid, doesnt sound hard i know, but i dont know what to do.

i know the function:

SendKeys "^{c}"

copys, but i dont know how to copy everything from within the textbox with it.

thanks alot toothpick

Copy From Flexgrid Into Textbox
Hi everyone, having a few problems. I need to copy a row of data from a flexgrid into a series of text boxes. I have the grid populated from an oracle table and all textboxes created ( 5 in total) but don't know how to populate these when a row is selected in the grid.

Any help would be much appreciated.

Preventing Copy From A Textbox
I have a textbox that I want to prevent someone from copying from. How can I do this?

Copy Textbox Into Listbox
I have a textbox full of processes like this:

VB Code:
[System Process]Systemsmss.execsrss.exewinlogon.exeservices.exesvchost.exesvchost.exesvchost.exeSmc.exeVB6.EXEfirefox.exe

etc.. I want to loop through it and put it into a listbox.

Printable Copy From A Textbox
hey everyone, i was asking about the ability to have the computer responding to a command that will print a text box after converting the program into an exe file.
please help me with such thing

Copy Locked Textbox
Is there an easy way to allow a user to copy text from a locked textbox? I need to display an ID number. The user may well want to copy the number to the clipborad though. I can add a keypress event to check for ctnl+c, but I'm not sure how to enable to Copy option in the right-click dropdown. Does anyone have code for this, or have a better control that would allow me to display text that can be copied but not changed?

Copy / Paste From Textbox
I have a textbox configured as locked which will contain alphanumeric references.
When double clicking on a reference only the alpha / numeric portion is selected and not the whole reference.
Does anyone know how to set this such that the while alphanumeric referenve would be selected ?

Copy Textbox To Clipboard????
ok so lets say i wanted to right click to copy the text in a textbox to a clipboard i would go like this

VB Code:
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)  If Button = vbRightButton Then    Clipboard.Clear   ' Clear Clipboard.    Clipboard.SetText Text1.Text   ' Put text on Clipboard.  End IfEnd Sub

but how would i make it so that popup menu wouldnt come know the one that has like copy cut paste ...etc

Copy From Textbox With Mouseclick?
Hi all

Can anyone give example how i can copy text from textbox with only left mouseclick on the textbox and after that paste this in to the notepad with control V manualy.

Cut, Copy And Paste Into A Textbox....

Though I had this one with the help someone on here, but it's not working right.

I am trying to get the Right click options of "Cut, Copy and Paste" to work when a user right clicks in a textbox on a userform.

With the help of a guy in here I did have Right click working, but when pasting the info it actually went into the cell directly behind the text box.

I need it to go into the text box.

If it's any help their should only ever be numbers that are copied from an AS4000 application, and then pasted into the textbox. I know keyboard shortcuts work, but I am not going to train 200+ people in the joys of keyboard shortcuts. (That would just be tempting a server meltdown - It's on it's last legs already.)

The Internet.... Where Men Are Men..... Women Are Men....... And Children Are FBI Agents !!!!

Copy Combobox Value To Textbox
I am the newest of newbies.

I have a combobox (dropdown list only - no text entry option) called Mechandise that contains a list of items for sale. What I want is for the user to do this:

1. Click on the Down Arrow at the right-hand end of the combobox, causing the list of items to drop down.
2. Click on the item that he wants to purchase.
3. Have the name of the item appear at the top of the combobox and simultaneously have the price of the selected item appear in a textbox named txtPrice.

I know how to do this in 2 steps, using a Command Button and Select Case. What I would like to find out now is how to make this all happen in one step, without clicking on a Command Button.

Thanks in advance.

Copy And Paste To A Textbox
using a command button i want to copy and paste to a text box, this i can do quite easyly. i need to use several command buttons to input the same textbox. when i try this the second command button deletes the first command button entry. idealy i need the entries into the text box to be where the cursor is positioned. is there any code to do this
thankyou troy1

Copy Protecting My Application
Are there any simple copy protection methods for my application. Doesn't have to be military strength or anything as I will only be having about 50 people use the application. But I want some protection rather than nothing!


How To Copy From List Box Of Other Application
I have a programme (a Dictionary only .exe file) where all the words are in a list box I want to copy that list on to the clip board or in a text file. What API Code I can use.

Copy File From Within Application
I made an application and i inserted a .dll i created into it now i need to know how to make the application copy it from within itself to a specified directory..

Copy/paste To Another Application
This should be simple enough, but I'm trying to use VBA to copy and paste data from cells in an Excel 2000 workbook, to a Windows app (an IBM mainframe front end), which is already open.

How do I select the app window, and then paste the data?

I also thought about using sendkeys, instead of paste. Is this an option? I also want to hit the enter button after pasting the text.


Now sorted.

AppActivate "appname"

..was what I needed.

Edited by - oddbodd on 7/11/2007 3:45:09 AM

File Copy In VB.Net Application
Hi all,
 I have a situation in which my application has to copy some files available locally, to a server. The logged-in user does not have write permissions for the specified folder in the server. Is there any means so that i can copy the files to the server by the application. (Is there a way to run the application with different credentials). Help me out


Edited by - skumer on 1/2/2006 4:00:02 AM

Copy Bitmaps From One Application To Other
I have to VB application and I want to copy picture from one to the other.
I have the Dest application PictureBox hWnd and I'm doing the following:

DestDC = GetDC (DestHwnd)
di& = BitBlt(DestDC, 0, 0, 1000, 1000, MyPic.Hdc, 0, 0, SRCCOPY)

I don't have access to the destination application code (I have only the hWnd
of its PictureBox).

The result of this code is :The picture is copied to the destination PictureBox
but if I move a window above it, it erase the picture (although AutoRedraw = True).

How can I copy the picture and make it redraw as if I load it from disk with LoadPicture ?

Can I use LoadBitmap API to load a bitmap not from file but from HDC ?


Copy Textbox To Textbox
I read the rules and it said not to post to old threads but I have this same problem and this will not work for me cause it needs to copy from text1.text
to text2.text but it needs to do this more then one time so like this
text2.text = something like 1234567891093876283710
if I do
text1.text = text2.text
then it just changes my text1.text and makes it the same as text2
but I want it to copy text2 and leave what is in text1 so it would come out to this
text1.text would have now 2 in it something like
and would keep copying it so I can fill up text box
how would I do that then when I get all the numbers
I want in text1.text how would I save it to notepad??
thank you

Copy Textbox To Textbox
Im sorry guys but is now two years ago i used vb for the last time.

but please help.
For the local sport team i need to make tournament form.
It is a knock out form like this.

16 teams, playing against eachother. there will be 8 winners after that 4 winners and so on.

I made 16 textboxes and then 8 textboxes and so on.
I thought to simple and made a button like this

Private sub command_click()
text1.text = copy
text2.text = paste
End sub

but it wont work.
after i press the button both text boxes are empty.

What is the answer to copy text boxes.


Copy Contents Of A File Into A Textbox
I have a directory of sequentially named text files and I would like to be able to display the contents of each in a userform. The userform would have a textbox that would contain the text and two buttons 'Back' and 'Next' which would allow the user to cycle through the files in the directory. My question is, how do I get the data from the text file into the textbox without having to open the file?

Follow Path, Copy To Textbox...
I would like for my program to follow the path "C:documents and settings *USER* local settingshistory" and then print all of the history to a text or list box.
so my pregunta is, how should specify the path to it when *user* will be different on different computers, is there somesort of windows variable for the username that i could use and do something like "C:documents and settings" & windows.currentusername (or whatever) & "local settingshistory". Or maybe there is an easier way to get the history?
Then, how can i write the names of the folders to a textbox?

honestly, i have no idea where to go

Multiple Textbox And Label Copy
here is the case :
i made a program like this.
as you can see,there are some textbox and label in front of the text box.
is it possible to make a button that can make every text in label and textbox copied into clipboard so i can paste them into notepad?all text in one's like a simple report or something like that.

what i want is if i paste in the notepad so the pasted text is like this :


Diameter = x mm
Depth = y mm
Focus = z mm

x = txtdiameter.text
y = txtdepth.text
z = txtfocus.text

thanks for your help

How To Copy All In Webbrowser And Paste To The Textbox??
How to copy all in webbrowser and paste to the textbox when i press a button??
I don't know how to do it or is it possible.

Copy From OpenOffice Table To Textbox.....
Hi all, I am using OpenOffice with another application that sends a templated form with several textbox's over a LAN.

The OpenOffice doc's have tables in them and at the moment I have to copy the table to OpenOffice Spreadsheet then copy the contents to the textbox which works but the system that we are using is very slow and OpenOffice tends to crash the OS when two or more applications are running.

Is there a way I can copy the table paste it into a VBTextbox as text without using the Spreadsheet App?


How Do I Copy The Contents Of A Listbox To A Textbox
Hello to all,

I have got a Listbox and need to copy all of the contents of the Listbox to a Textbox so the listbox items are all on seperate lines in the Textbox and then at another stage in the program I need to copy the items of the Textbox back into the Listbox.

Any help would be much appreciated.


Lock Textbox But Can Still Copy From It [solved]
I have a text box that is locked, but i cant ctrl+c the text in it.
how can i lock a text box but still be able to copy from it?

How Do You Copy Excel Table Into VB TextBox?
I am trying to copy a range of cells in Excel into a VB TextBox. I can get it to work via to clipboard and then paste it into the TextBox. However, the resulting table is all over the place due to greatly varying length data in each cell in the table. If all the data in the table was about the same length, I would not have any problems.
Can anyone suggest how I can get the data to appear properly as a table in the Textbox? Note....I don't need gridlines in the textbox as it is only text.

Thanks for your help.

Copyright 2005-08, All rights reserved