Wrox Programmer Forums
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2004, 04:45 AM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sunitha_padmanabhan
Default Copying selected files in vb

Hello everybody,

   Iam Sunitha here, I want to create an application in vb which can copy a selected file from a particular path and create it many number of times, i.e., if I select a file sample.doc from C: drive and give 2 in the text box it has to create the sample.doc two times in a specified drive might be D: or E:, any suggestions for the above problem.

Thanks,
Sunitha

Sunitha
 
Old October 13th, 2004, 07:22 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

But one file cannot be created more than once with same name in the same location.
Along with number of files to create, is there any input text box
where the path(s) will be entered?




Om Prakash
 
Old November 15th, 2004, 07:43 AM
Registered User
 
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to belzicool
Default

check this link:
http://www.freevbcode.com/ShowCode.a...499&NoBox=True

you can give the source file path and destination file path as arguments using the function in the above link.
If a user gives input as say 3 copies of file "count.xls", then use the copy function in loop and add a string to the filename every time it copies.

using the function from the link,
for i=1 to 3
shellfilecopy("c:\count.xls","f:\" & "count" & integer2string(i)& ".xls")

integer to string will be a function which will convert an integer to string.
hence u will get fiels of the name count1.xls,count2.xls,count3.xls

hope it helps







Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files error kwik10z Excel VBA 1 November 10th, 2007 10:11 PM
Copying data across files sda443 Excel VBA 2 January 16th, 2006 06:49 AM
Copying Multiple Rows in MS Excel 2K using VB .Net Azhar Akbari Excel VBA 2 January 27th, 2005 10:04 AM
Copying files using VBScript in ADO 3.0 munrrob Classic ASP Basics 2 October 26th, 2004 05:35 AM
Copying files marclena General .NET 2 June 18th, 2004 08:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.