Not a Member Yet,
Click here to Register
How do you like the new design?






ID: 147
Viewed: 2892
Added: Apr 28, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

API call for save as..

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
sub click()
Dim filenum As Integer
Dim Ingredients As String
Dim lab As String
Dim recname As String
Dim proc As String
Dim ofn As OPENFILENAME

Ingredients = TxtIngredients.Text
lab = Label1.Caption
recname = LblName.Caption
proc = TxtProcessTest


ofn.lStructSize = Len(ofn)
ofn.hwndOwner = FrmResult.hwnd
ofn.hInstance = App.hInstance
ofn.lpstrFilter = "Document Files (*.doc)" + Chr$(0) + _
"*.doc" + Chr$(0) + "Text Files (*.txt)" + Chr$(0) + _
"*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) _
+ "*.*" + Chr$(0)
ofn.lpstrFile = Space$(254)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space$(254)
ofn.nMaxFileTitle = 255
ofn.lpstrInitialDir = CurDir
ofn.lpstrTitle = "Dialog Title"
ofn.flags = 0
Dim a
a = GetSaveFileName(ofn)

If (a) Then
MsgBox "File Saved To: " + Trim$(ofn.lpstrFile)
'FileSave Stuff Here

ofn.lpstrFile = Left(ofn.lpstrFile, InStr(ofn.lpstrFile, Chr$(0)) - 1)
If Right$(LCase$(ofn.lpstrFile), 4) <> ".txt" Then
ofn.lpstrFile = ofn.lpstrFile & ".txt"
End If

Open ofn.lpstrFile For Output As #1
Print #1, lab; Space$(3); recname
Print #1, Ingredients; proc
FrmResult.SetFocus
Close #1
Else
MsgBox "Cancel was pressed"
End If
Close #1

End Sub;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions