Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 2nd, 2006, 02:55 AM
Registered User
 
Join Date: Sep 2006
Location: Karachi, , Pakistan.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy text to win Clipboard

Is there is anyway (i m sure, there is) to copy the text of Textbox to Clipboard.. ? So, as the text can be pasted in any other softwrae l

please let me know

Learn from the mistakes of others. You can't live long enough to make them all yourself
Reply With Quote
  #2 (permalink)  
Old October 2nd, 2006, 03:00 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

    Clipboard.Clear
    Clipboard.SetText Text1.Text, vbCFText

Reply With Quote
  #3 (permalink)  
Old October 2nd, 2006, 03:29 AM
Registered User
 
Join Date: Sep 2006
Location: Karachi, , Pakistan.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your code simply result in Error...'424 Object Required'

Well i want to make a confession here that i really missed to mention:
1. That i am a newbie, so plz be more descriptive
2. That i have placed a command button, clicking to which will copy the text to the clipboard just like Ctrl+C does...

Learn from the mistakes of others. You can't live long enough to make them all yourself
Reply With Quote
  #4 (permalink)  
Old October 2nd, 2006, 08:37 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

Option Explicit

Private Sub Command1_Click()
    Clipboard.Clear
    Clipboard.SetText Text1.Text, vbCFText
End Sub

r u writing it like this???
coz its a tested code n it works for me


Reply With Quote
  #5 (permalink)  
Old October 5th, 2006, 12:19 AM
Registered User
 
Join Date: Sep 2006
Location: Karachi, , Pakistan.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

anyways i got the sol from another guy at another website... for the benefit of everybody... here is the code:

Private Sub CommandButton1_Click()
       With Me.OLEObjects("TextBox1").Object
           .SelStart = 0
           .SelLength = Len(TextBox1.Text)
           .Copy
       End With
End Sub

Learn from the mistakes of others. You can't live long enough to make them all yourself
Reply With Quote
  #6 (permalink)  
Old October 5th, 2006, 06:02 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

m using VB6 with SP6...
and when i run this code..i get msg tht Method or Data Member not found

whts this OLEObjects???

bcoz its giving error here



Reply With Quote
  #7 (permalink)  
Old October 5th, 2006, 06:04 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

r u using any reference

bcoz the code tht i gave works without including any reference

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Changes or Copy to clipboard JezLisle Access VBA 4 November 20th, 2008 10:24 AM
Copy Metafile to the Clipboard TMA_Master BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 1 August 26th, 2008 10:59 PM
Copy to clipboard in EMF format. watashi C# 1 April 17th, 2008 09:02 AM
how to copy text in a word file on the clipboard donrafeal Word VBA 3 February 1st, 2007 12:32 AM
Copy to Clipboard Clive Astley Access 5 July 16th, 2004 07:16 PM



All times are GMT -4. The time now is 08:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.