Pls Help Clipboard.Clear Not clearing the clipboard
Hail to All,
Ok here is the problem I am having. Clipboard.Clear it not clearing the clipboard on all machines my program is run on. Most machines it works fine. Other still have what was previously copied. Here is a test I run.
one button has
Clipboard.Clear
Clipboard.SetText "This is a test"
the other button has
Clipboard.Clear
Clipboard.SetText "This is the second test"
Now they go to a blank document of some type notepad word or an e-mail program and hit ctrl-V and it pastes what was previously in the cipboard even though I cleared it. Now if they go to a program like word and manual clear the clipboard they can click button one and it pastes 'This is a test' they then click the second button and it pastes the same text that is in the first button because the clipboard for some reason is not cleared. So, they are having to manually clear the clipboard each time.
Anyone have any ideas?
Thanks for all your help.
Mythos
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Quote:
Originally Posted by Mythos44
Ok here is the problem I am having. Clipboard.Clear it not clearing the clipboard on all machines my program is run on. Most machines it works fine. Other still have what was previously copied.
There is seldom a clear cut answer to problems like these.
Lets start with the machines.
Does this behavior consistently happen on the machines it is not clearing on? I.E., does it never, ever clear, or, even on these machines, does it clear sometimes?
What are the differences in the machines that it works on and those that it does not work on? Brand Names? OS version? Service Pack Level?
Do the machines that it does not clear on run software that the others do not?
Re: Pls Help Clipboard.Clear Not clearing the clipboard
they are all suposed to be identical machines with identical software. I did find an instance if they had a program called printkey2000 open it couldn't clear the clipboard so we can get around that. Though I thought it should clear the clipboard no matter what seeing as that is what the code is suposed to do. is there any other way to force the clipboard to clear seeing as MS Word is able to do this.
Thanks again,
Mythos
Re: Pls Help Clipboard.Clear Not clearing the clipboard
MS Word is not written in Visual Basic.
Clipboard.Clear is the only VB way I'm familiar with.
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Just for giggles, I just tried this and it seemed to work (but, Clipboard.Clear also works without any problems for me and on all of the machines on which I have apps deployed)
Give it shot and see what happens.
Code:
Clipboard.Clear
Clipboard.SetText vbNullString
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Ok this does still does not clear the clipboard though the string is now added and when they hit ctrl-v it adds the latest string. So it's not 100% but it will do. Thanks so much for your help. It is greatly appreciated.
Mythos
Re: Pls Help Clipboard.Clear Not clearing the clipboard
You should continue your investigation in an attempt to find out what is going on with those few machines.
If you do find the issue, post back what it was and what you did.
Re: Pls Help Clipboard.Clear Not clearing the clipboard
The computers it's not working on aren't running a Clipboard manager of any sort, are they?
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Like what, for instance? (I'm not familiar with Clipboard managers.)
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Like MS-Office clipboard manager (multiple copy/paste history) but works with windows clipboard.
Re: Pls Help Clipboard.Clear Not clearing the clipboard
Ive had a similar problem where we would clear the clipboard, but it would still error out saying its full if the next line attempted to add to it. DoEvents after the clear took care of it, may be worth a try.