|
-
Nov 12th, 2007, 05:20 PM
#1
Thread Starter
Frenzied Member
[2005] Export notepad doc....
On the click of a button I want to write stuff onto a note pad and open this up so I can copy and paste it to another program...
It's a SQL syntax for every item in a listbox...
So for each item in my list box as string "items" I want to print this with the right items in it's right place... and a line between how can I do this??
Code:
INSERT INTO `travel_photos` ( `id` , `photoname` , `trip_id` , `takenby` , `location` , `details` , `private` , `degrees` , `hits` , `date` , `front` ) VALUES ('', 'items', '11', '', '', '', '0', '0', '0', '0000-00-00', '');
The looping part I can do it's just writing to a text file and opening it up... I don't need it saved anywhere
-
Nov 12th, 2007, 05:25 PM
#2
Re: [2005] Export notepad doc....
So you are saying that your listbox has sql queryies in each item and you want to write them out to a file?
You can write using the System.IO.File class.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 12th, 2007, 05:41 PM
#3
Re: [2005] Export notepad doc....
If copy-paste is all you want to do, you can use the Clipboard class.
-
Nov 13th, 2007, 01:06 AM
#4
Thread Starter
Frenzied Member
Re: [2005] Export notepad doc....
No my listbox will have file names.... I'll add the rest of the SQL around the file name. When I click the button I want it to open the notepad and print the SQL statement for each item in the list box in the right place.
-
Nov 13th, 2007, 03:02 AM
#5
Re: [2005] Export notepad doc....
Use the .Tag property of the listbox items to stire the sql text. Then upon selection you can use the .SelectedItem to retrieve the text and the tag for writting to a temp file and process.start with notepad.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 13th, 2007, 09:24 AM
#6
Re: [2005] Export notepad doc....
Well, since you stated that you don't need to save the queries to a file but rather just to display it in a notepad, simplest way is to create a form with a textbox with multiline = true and dock = fill. You then can just set the text and show the form. If you are to write your queries to a textfile and open it, you'll need to delete the file when your user is done (and it's hard to detect when the user is done with that file).
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
|