| | |
Formatting clipboard text for spreadsheets
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2005
Posts: 32
Reputation:
Solved Threads: 0
I have a VB program that produces reports by sending text to various list boxes.
I want to add the option to have the reports sent to the clipboard. I imagion most users would then want to paste the information into a spreadsheet.
I have figured out that adding chr$(13) to the end of each line of text will make the text in the clipboard appear on the next line.
1. Is there a character I can add to the string that would make the next part of the string (when pasted into a spreadsheet) appear in the next spreadsheet column.
2. Is there an easy way to send all the text that is already in the list box to the clipboard, or will I have to create a huge string to do this.
Thanks.
I want to add the option to have the reports sent to the clipboard. I imagion most users would then want to paste the information into a spreadsheet.
I have figured out that adding chr$(13) to the end of each line of text will make the text in the clipboard appear on the next line.
1. Is there a character I can add to the string that would make the next part of the string (when pasted into a spreadsheet) appear in the next spreadsheet column.
2. Is there an easy way to send all the text that is already in the list box to the clipboard, or will I have to create a huge string to do this.
Thanks.
You'll have to create a huge string. As far as I can tell, updating the clipboard with VB6 overwrites what was there previously. Just like if you keep opening a file for output instead of append. The easy solution is to have 1 variable that keeps getting concantenated during a loop, and then assign the clipboard the value of the variable....
•
•
Join Date: Mar 2005
Posts: 32
Reputation:
Solved Threads: 0
Yes, It appears that each time you send text to the clipboard (clipboard.settext Astring$) the previous text is deleted, so adding to it line by line would only leave the last line there! Seems that assembling a huge string is the only obvious option. I already have the code for sending the reports to a listbox, so that will help. I checked out how big a string can be in VB5 and in help is says approx. 2 billion characters so no problem there. Some of the reports will be several thousand charactes long. I hope the clipboard does not have a low limit though!
![]() |
Similar Threads
- Get the text with mouse hover (JavaScript / DHTML / AJAX)
- onClick Events to Change to dynamic text (HTML and CSS)
- using the clipboard (Visual Basic 4 / 5 / 6)
- PHP for emailed forms (PHP)
- Mail Formatting lost when sending from Panther "mail" app. (Mac Software)
- how do i keep a blinking cursor on the site? (JavaScript / DHTML / AJAX)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Problem: Programming Tab Control
- Next Thread: How can I modify it?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






