|
-
Apr 24th, 2000, 05:10 AM
#1
Thread Starter
Addicted Member
I know you can use a commondialog box to save, open etc. but can you do it without using a commondialog box.
Example if I want to save a file to a certain directory using code only how would I do this. Does anybody has a answer?
-
Apr 24th, 2000, 05:54 AM
#2
Addicted Member
Do you mean the actual saving of the file or the interface that allows the user to select the save location?
To save a file you have to use the Open statement to write the data to a file, this is the most direct way. If you want an easier method you could use the Microsoft Scripting Runtime reference (scrrun.dll), it has a lot built-in file system functionlity. Also, some controls have a save method built into them as well, such as the RichTextBox.
If you mean the interface you could make your own custom form containing a FileListBox, a DirListBox, a DriveListBox, and a TextBox (to type new file names). That would allow the user to select the save path. If you want to use something like the CommonDialog but don't like the file size of its OCX the you could use the API methods exposed by the COMMDLG.DLL, however this requires a fair amount of API knowledge and uses callbacks to implement.
I hope this helps to answer your question.
PS Hey "Batman", the bat-jargon is starting to get a little old, it was slightly amusing at first, but it's quickly getting bothersome (soon to be annoying). How 'bout a new alias?
-
Apr 24th, 2000, 05:59 AM
#3
Hyperactive Member
Try this:
Sub Befehl1_Click ()
On Error GoTo 1
Open "C:\FILENAME.TXT" For Output As #1
Print #1, Text1.Text;
Close #1
MousePointer = 1
1
Exit Sub
End Sub
Good Luck, Matt-D(eutschland)
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
|