TheBaker
asked on
Clipboard Problem
I've written a program that uses Clipboard.SetText to copy some text from a textbox. It copies it and my program can then paste that data into other text boxes. But when I try and paste the copied data into a different program, it pastes whatever was on the clipboard that wasn't set by my program.
I came to the conclusion that the Clipboard.SetText function must be a local function, that uses an internal app clipboard, not the system one. So how do I access the system clipboard from VB and paste text to it.
I'd appreciate a quick answer as I need to upgrade the program that some users have already downloaded.
I came to the conclusion that the Clipboard.SetText function must be a local function, that uses an internal app clipboard, not the system one. So how do I access the system clipboard from VB and paste text to it.
I'd appreciate a quick answer as I need to upgrade the program that some users have already downloaded.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nope, that still hasn't done it. I clear the clipboard before setting the text but it still does the same thing!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you have to clear the clipboard first
sub cmdClear_OnClick
clipboard.clear
clipboard.settext text1.text
end sub
sub cmdClear_OnClick
clipboard.clear
clipboard.settext text1.text
end sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The max u wud hav to do is:
Clipboard.Clear
Clipboard.SetText text1.text, vbCFText
Clipboard.Clear
Clipboard.SetText text1.text, vbCFText
ASKER
I've tried clearing the data, but I still have the same problem. I can't close all other apps, because I need a browser open (the text copied needs to be pasted into a web browser.
Would using the clipboard via the Windows API work? Could someone give me an example of how to copy text using the Windows API?
Would using the clipboard via the Windows API work? Could someone give me an example of how to copy text using the Windows API?
ASKER
I can provide the compiled program if that will help. It is:
http://freehost14.websamba.com:81/NDifference/content/smileyxtra_setup.exe
http://freehost14.websamba.com:81/NDifference/content/smileyxtra_setup.exe
ASKER
I've managed to solve the problem, I'm not sure quite what was happenning, but it's fixed now. Thanks to all that helped. I've split the points between those who's answers led me to the solution.
ASKER