[vb6] Put text in the Clipboard

Sauvegarde2 Posted messages 219 Status Member -  
 bast7373 -
Bonjour,
I am currently working on a program and I would like it to send text to another program.
I am using the following code:

Boite.SelStart = 0
Boite.SelLength = Len(Boite.Text)
SendKeys ("^{x}")
AppActivate ("OpenOffice.org Writer")
SendKeys ("^{v}")

But strangely, SendKeys ("^{x}") only works when it is alone: as soon as I add code afterwards, it stops working. I have tried various tricks but none have worked :x

Could you tell me how to make SendKeys work, or alternatively how we can write to the clipboard (using the clipboard method)?
Please :D

3 answers

  1. bast7373
     


    Clipboard.SetText (your text box.text)
    your text box.Text = Clipboard.GetText

    for something other than text do the following:

    Clipboard.SetText (the name of your thing)
    the name of your thing = Clipboard.GetText

    is that what you wanted?
    1
  2. Sauvegarde2 Posted messages 219 Status Member 261
     
    Aidez-moi !
    0
  3. Sauvegarde2 Posted messages 219 Status Member 261
     
    Help²
    0