-
December 6th, 2008, 09:02 PM
#1
[RESOLVED] copy and paste help
I am working on a program from my work, its a layway calculator. The problem i am running into is that they need to enter the information in to a different program. My goal is to speed the process up. What I am trying to do is add a copy feature that gets the information in the proper format so that it can be pasted in to other program. When i send the text to the multi lined text box using vbcr for the return it does not go to a new line it just creates a box. Please help Thanks.
-
December 6th, 2008, 09:34 PM
#2
Re: copy and paste help
Welcome to the forums!
May we see some code on how you are doing it? And enclose them with [code] tags.
-
December 6th, 2008, 11:04 PM
#3
Re: copy and paste help
I'm not clear on exactly what you are trying to accomplish. If you are trying to combine text strings and display in a text box and copy to the clipboard then this code will work:
Code:
Dim NewText As String
NewText = "This is line number one" & vbCrLf
NewText = NewText + "This line number two"
Text1.Text = NewText
Clipboard.Clear
Clipboard.SetText NewText
Tom
-
December 7th, 2008, 11:59 PM
#4
Re: copy and paste help
Almost:
Code:
NewText = NewText + "This line number two"
should be:
Code:
NewText = NewText & "This line number two"
-
December 8th, 2008, 10:42 AM
#5
Re: copy and paste help
LOL... you, of course, are correct dglienna. It should be an ampersand rather than the plus sign. However, the code still executes properly using the plus sign.
One other important thing to note in regards to the original question is whether the TextBox Multiline property is set to True. If not, you'll see the vbCrLf as a character which may be the "box" to which you referred.
-
December 8th, 2008, 07:17 PM
#6
Re: copy and paste help
Not necessarily:
Code:
Dim NewText as Integer
NewText = 3
NewText = NewText + "This line number two"
That wouldn't work
-
December 8th, 2008, 09:52 PM
#7
Re: copy and paste help
Thank you for your replies and I wish I had time to try that and post some of the code but I am really busy now. I will try that out and get back ASAP. Thanks again!!
-
December 8th, 2008, 10:08 PM
#8
Re: copy and paste help
Originally Posted by dglienna
Not necessarily:
Code:
Dim NewText as Integer
NewText = 3
NewText = NewText + "This line number two"
That wouldn't work
Nor would the ampersand work with your code.
-
December 9th, 2008, 12:23 PM
#9
Re: copy and paste help
Thank very much Tom Moran and to the rest of you. I got it to work by adding the vbCrLf. I was using vbCr. Thank you again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|