Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Files For Later Use 1

Status
Not open for further replies.

Boxster1987

Programmer
Aug 9, 2002
19
US
Is there a way to save files in registry to be called back when you run the program again?

Thanks.
 

Look up in your help file SaveSetting and GetSetting. Although I would not try to save the contents of a file to the registry, but I would save the path to it in there.
 
Hey Ryan
go to references and then choose microsoft scripting run time and then write these codes:

Dim fso As New FileSystemObject
Dim tstream as TextStream
spath = App.Path & "\NewFile.txt"
Set tstream = fso_OpenTextFile(spath, Forwriting, , TristateFalse)
tstream.Write Text1.Text
tstream.Close
Set fso = Nothing
Set fso = Nothing
'All above would save the file

'For loading wrote these codes:

Dim fso As New FileSystemObject
spath = App.Path & "\NewFile.txt"
Set tstream = fso_OpenTextFile(spath, ForReading, , TristateFalse)
If Not tstream.AtEndOfStream Then
Text1.Text = tstream.ReadAll
tstream.Close
End If

Hope this help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top