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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie put function help

Status
Not open for further replies.

GOOGE

Technical User
Jun 20, 2001
36
NZ
hi
i have writen a cataloging program and i want to have a backup and restore option, but i want it to back up as one file,i have to back up jpg and txt files and after i have backed them up into one file i want to be able to restore all those files back to jpg and txt.i dont want to use winzip or anything like that as i want this program to be stand alone and not relly on the user to have these other programs on there system. somebody suggested that i back them up as a binary text file useing the put function. can i do this if so can somebody point me into the right direction. i would love to be able to zip and unzip them but like i say i dont want to relly on other programs.

is the put function the best option or is there a better way.all you help is much appreciated. i know you can use pkzip and install the pkzip components with your application but i dont want to spend any money buying other addons so any advise is greatfully recieved.

thanks in advance

james cuttance
 
If you have the msdn library investigate propert bags. These are awesome for what your doing. If you don't have the msdn I will post an example. Brad,
Free mp3 player,games and more.
 
i will have a look a msdn library,but if you could post a example i would much appreciate it

thanks

james cuttance
 
Okay here you are,

Dim pb As PropertyBag
Dim vartemp As Variant
Dim hFile As Long

Set pb = New PropertyBag

hFile = FreeFile

Open CommonDialog1.FileName For Binary As hFile
'put file were commodialg is.

'here is the header and the file
pb.WriteProperty "AddPictureDown", add.DownPicture

vartemp = pb.Contents
Put hFile, , vartemp
Close hFile
Brad,
Free mp3 player,games and more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top