|
-
May 28th, 2001, 02:19 PM
#1
Error When Saving To Text File - Please Help
I am making a program in VB5 for my High School senior project, this question is relating to the vocab section of the program. In this section, the user has the option to selct from a number of premade vocab lists which are stored in a folder in the same directory as the progem, when one of these premade lists are selected it is opened and loaded into a listbox. This part of the vocab section works, but the second option that the user can do is to create there own lists. Everything works fine except, when the user goes to save the new list a path not found error pops up. Heres my question, is there a way to create a .txt file and then save the new list to that .txt file so that the path will exist?
Here's my code:
private Sub SaveBtn_Click()
Dim ListNum as Integer
Dim SFileName as string
Dim SFilePath as string
ListNum = ListNum + 1
SFileName = "NewList" + CStr(ListNum)
SFilePath = App.Path + "\EngVocab\NewLists\"
Open SFilePath + SFileName for Output as #1
for X = 0 to NewList.ListCount - 1
print #1, NewList.List(X)
next X
Close #1
End Sub
Please respond as soon as possible
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
|