|
-
Oct 20th, 2000, 12:25 AM
#1
Thread Starter
Addicted Member
I can code my save mnu to work but how can I code a Save As?
I appreciate any help you have to offer,
Daniel Christie
-
Oct 20th, 2000, 03:29 AM
#2
Hyperactive Member
Open a common dialogue save box.
Regards
Chris
-
Oct 20th, 2000, 05:41 AM
#3
Hyperactive Member
If you want to save a Rich Text Box as Rich Text File I found some code here (credits to Matthew Gates):
Code:
'AS RTF
'Save
RichTextBox1.SaveFile "C:\MyFile.rtf",
'Load
RichTextBox1.LoadFile "C:\MyFile.rtf",
AS TXT
'Save
RichTextBox1.SaveFile "C:\MyFile.txt",
'Load
RichTextBox1.LoadFile "C:\MyFile.rtf",
You can replace "C:\MyFile.rtf" or .txt in a string variable that was previously saved by a Save dialog.
Good Luck
-
Oct 20th, 2000, 02:37 PM
#4
To code save as, do as chrisa_uk suggested. Here is how to do that:
Code:
Private Sub mnuSave_Click()
Dim iFile As Integer
On Error GoTo User_Cancelled
With CommonDialog1
.CancelError = True
.DialogTitle = "Save a Text File.."
.Filter = "Txt files (*.txt)|*.txt"
.ShowSave
iFile = FreeFile
Open .filename For Output As iFile
Print #1, Text1.text
Close iFile
End With
User_Cancelled:
End Sub
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
|