Visual Basic Code for Copy

  • Thread starter Thread starter Uplink2069
  • Start date Start date
U

Uplink2069

Guest
could someone help me with a visual basic task i have. i need to set a variable from a text box, which i can do (see below)

Private Sub Command1_Click()
Dim MyVar
MyVar = Text1.Text
Text2.Text = MyVar
End Sub

but how do i get it to add the data in Text1 to the computers clipboard for use in other programs (such as notepad) instead of just moving the text?im not sure if this is possible in VB but it would be very useful if someone out there knows if it can be done, and if so, how.
 
See Microsoft Knowledgebase articles:

ACC: How to Send Information to the Clipboard (95/97)
ID: Q138909

AND

HOWTO: Call Clipboard API from Visual Basic 4.0
ID: Q159823
 
API. im working on one of them (API) at the moment but i but understand how to call it. ive pasted it into a module, but i can't get then syntax correct in the form code. the 'ByVal' stuff i dont know what it means. i think it means that values need to be inserted after the statement but agains, i dunno the correct syntax
 
The articles have samples to play with. Try walking through the sample to get an understanding of what is happening.

Also the articles describe the values that need to be passed to the APIs.
 

Users who are viewing this thread

Back
Top Bottom