-
Nov 10th, 2000, 03:45 PM
#1
Thread Starter
Hyperactive Member
Hi all,
I am new at this and really don't know how to use a
dialog box to save a file as. I found a sample to
open a file, but not a save as.
Here is a sample code:
Private Sub Command1_Click()
' IS THIS SUPPOSED TO SWITCH TO SAVE AS?
CommonDialog1.Flags = cdlOFNCreatePrompt
' default directory
CommonDialog1.InitDir = App.Path
CommonDialog1.Filter = "All Files (*.*)|*.*|Text " & _
" Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' Specify default filter.
CommonDialog1.FilterIndex = 2
' Display the Open dialog box.
CommonDialog1.ShowOpen
' Call the open file procedure.
' OpenFile (CommonDialog1.filename)
fileout = CommonDialog1.FileName
End Sub
-
Nov 10th, 2000, 03:55 PM
#2
transcendental analytic
I think you should use this instead to save
CommonDialog1.ShowSave
although, the dialogs are the same you don't want it to be titled "open file".
The difference between save and save as isn't the dialog, to show the save dialog is to save as, and the exception of it is save, when you already have the filename. therefore when you choose save you check for the length of the filename property and open it only when it's 0.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 10th, 2000, 04:01 PM
#3
Thread Starter
Hyperactive Member
Thanks Kedaman
You have been very helpful to me. Perhaps someday when
I know a little more about VB, and make lot$ of money,
we can meet and have some beer.
Until then, you make it a good weekend, and thanks again.
-
Nov 10th, 2000, 04:31 PM
#4
Frenzied Member
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
|