Hello,
I am trying to create a program that would replicate different selected files "x" times into a specified directory and save them with filename indexes. Then after create a log list of the successfully copied files via LogListBtn click ( maybe saving the text file in the C: root)
ex.
a. Help.txt ( copy 3x ), Report.xls ( copy 2x )
When they are saved in a specified directory they should look like:
Help(1).txt
Help(2).txt
Help(3).txt
Report(1).xls
Report(2).xls
By the way this is my code in adding the selected files by drag dropping them in a FRAME, then creating 2 textboxes in 1 row where:
Text1 ( as textbox ) - where full path and filename is displayed
CopyTimes ( as textbox ) - number entry for x times a file is to be copied -
Private Sub DropArea_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Dim i As Integer
-
Dim dCount As Integer
-
-
On Error GoTo No_File_info
-
i = Text1.count - 1
-
-
For dCount = 1 To Data.Files.count
-
-
Load Text1(i + dCount)
-
With Text1(i + dCount)
-
.Top = Text1(i + dCount - 1).Top + Text1(0).Height
-
.Text = (Data.Files.Item(dCount))
-
.Visible = True
-
-
End With
-
-
Load CopyTimes(i + dCount)
-
With CopyTimes(i + dCount)
-
.Top = CopyTimes(i + dCount - 1).Top + CopyTimes(0).Height
-
'.Text = i + dCount
-
.Visible = True
-
End With
-
-
Next
-
FrameSlide.Height = Text1.count * Text1(0).Height
-
If FrameSlide.Height > FrameFix.Height Then
-
With VScrollFiles
-
.Max = (FrameSlide.Height - FrameFix.Height) / 10
-
.SmallChange = 200
-
.LargeChange = FrameFix.Height / 10
-
.Visible = True
-
End With
-
Else
-
VScrollFiles.Visible = False
-
End If
-
Exit Sub
-
No_File_info:
-
MsgBox "No File name from Explorer"
-
End Sub
-
I can't seem to find a code on how to replicate these files to my destination directory which is at SaveTo ( as textbox ).
This is the full code of the program: -
Option Explicit
-
Dim fselectIDX As Integer
-
-
Private Sub CopyTimes_KeyPress(Index As Integer, KeyAscii As Integer)
-
If Not (KeyAscii = vbKeyBack) Then
-
If Not Chr(KeyAscii) Like "#" Then
-
KeyAscii = 0
-
MsgBox ("Number entry only.")
-
End If
-
End If
-
End Sub
-
-
Private Sub Form_Load()
-
DropArea.OLEDropMode = 1 '§ manual
-
Text1(0).Top = -Text1(0).Height + 180
-
CopyTimes(0).Top = -CopyTimes(0).Height + 180
-
-
With VScrollFiles
-
.Visible = False
-
.Min = -30
-
End With
-
-
End Sub
-
-
-
Private Sub Dir1_Click()
-
SaveTo.Text = Dir1.Path
-
End Sub
-
-
Private Sub Drive1_Change()
-
Dir1.Path = Drive1.Drive
-
End Sub
-
-
Private Sub OpenWEBtn_Click()
-
Dim Det As Long
-
Det = Shell("explorer.exe /e, C:\", vbNormalFocus)
-
End Sub
-
-
Private Sub DropArea_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Dim i As Integer
-
Dim dCount As Integer
-
-
On Error GoTo No_File_info
-
i = Text1.count - 1
-
-
For dCount = 1 To Data.Files.count
-
-
Load Text1(i + dCount)
-
With Text1(i + dCount)
-
.Top = Text1(i + dCount - 1).Top + Text1(0).Height
-
.Text = (Data.Files.Item(dCount))
-
.Visible = True
-
-
End With
-
-
Load CopyTimes(i + dCount)
-
With CopyTimes(i + dCount)
-
.Top = CopyTimes(i + dCount - 1).Top + CopyTimes(0).Height
-
'.Text = i + dCount
-
.Visible = True
-
End With
-
-
-
Next
-
FrameSlide.Height = Text1.count * Text1(0).Height
-
If FrameSlide.Height > FrameFix.Height Then
-
With VScrollFiles
-
.Max = (FrameSlide.Height - FrameFix.Height) / 10
-
.SmallChange = 200
-
.LargeChange = FrameFix.Height / 10
-
.Visible = True
-
End With
-
Else
-
VScrollFiles.Visible = False
-
End If
-
Exit Sub
-
No_File_info:
-
MsgBox "No File name from Explorer"
-
End Sub
-
-
-
Private Sub Text1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
fselectIDX = Index
-
If Button = vbKeyLButton Then PopupMenu PUMenu_Files
-
End Sub
-
'§ =============================================
-
'§ MENUS
-
'§ =============================================
-
-
Private Sub PUMenu_DeleteFile_Click()
-
Dim BOXidx As Integer
-
If fselectIDX <> Text1.count Then '§ if not last box
-
For BOXidx = fselectIDX To Text1.count - 2
-
Text1(BOXidx).Text = Text1(BOXidx + 1).Text
-
CopyTimes(BOXidx).Text = CopyTimes(BOXidx + 1).Text
-
Next
-
Unload Text1(Text1.count - 1)
-
Unload CopyTimes(CopyTimes.count - 1)
-
Else '§ if last box
-
Unload Text1(fselectIDX)
-
Unload CopyTimes(fselectIDX)
-
End If
-
Call Calc_FrameSlide_Height
-
End Sub
-
-
Private Sub VScrollFiles_Change()
-
FrameSlide.Top = -VScrollFiles.Value * 10
-
End Sub
-
-
'§ =============================================
-
'§ FUNCTIONS
-
'§ =============================================
-
-
Private Function Calc_FrameSlide_Height()
-
FrameSlide.Height = Text1.count * Text1(0).Height
-
If FrameSlide.Height > FrameFix.Height Then
-
With VScrollFiles
-
.Max = (FrameSlide.Height - FrameFix.Height) / 10
-
.SmallChange = 200
-
.LargeChange = FrameFix.Height / 10
-
.Visible = True
-
End With
-
Else
-
VScrollFiles.Visible = False
-
End If
-
End Function
-
Tool UI:
Buttons not working yet are:
a. Replicate Button
- should be able to replicate selected file/s into destination directory "x" times
b. Log List Button
- should be able to create a text file saved at C: root drive with name LogList.txt with format:
1. file(1).txt
2. file(2).txt
3. file(3).txt
4. file(1).xls
5. file(2).xls
.......
Please help.
Thanks!
1 1338
correction for the Tool UI ( I removed the checkboxes already).
I hope somebody could help me.
Thank You.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: steve |
last post by:
I am quite frustrated with php’s include, as I have spent a ton of
time on it already... anyone can tell me why it was designed like this
(or something I don’t get)?
The path in include is relative NOT to the immediate script that is
including it, but is relative to the top-level calling script.
In practice, this means that you have to constantly worry and adjust
paths in includes, based on the startup scripts that call these...
|
by: Jan |
last post by:
I store sql-commands in a database table. In the first step I get the
sql command out of the database table with embedded sql. In the second
step I try to execute the command, which i got from the database
table, using dynamic sql.
Executing 'EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;' the
error code -2149 is returned That means "Specified partition does not
exist".
Does anybody know if it is a database problem or a problem of
|
by: brian.newman |
last post by:
I'm trying to use a layer inside a form to hide/reveal a part of the
form, but my code doesn't seem to be working and I need some help
debugging it.
I'm not getting an error which has made it difficult to debug the code,
but I am getting the alert ("break 4 in getStyleObject"); which makes
me think this is a browser compatability issue (I'm running IE 6.0).
Anyway, the code follows
function getStyleObject (objectId) {
alert ("begin...
|
by: |
last post by:
I am working on a web/webservice application that has a service layer. Most
service methods will perform an access-check before executing. This check
uses the IPrincipal credentials available in HttpContext.Current. This works
great.
My issue is that I need to write unit tests for those service methods. These
tests then run outside of IIS, thus there is no HttpContext.Current
available - and the servicemethod will not execute.
The two...
|
by: nicholas |
last post by:
Although in my web.config I have <customErrors mode="off" /> I still get no
detailed errors.
How comes ?
THX
This is what I get:
Server Error in '/mywebfolder'Application.
| |
by: Savas Ates |
last post by:
I have a web application It works well in my local folder.. When i upload
it
to my web server i got
To enable the details of this specific error message to be viewable on
remote machines, please create a <customErrors> tag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrors> tag should then have its "mode" attribute
set to "Off".
|
by: laredotornado |
last post by:
Hi,
I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed
using Apache's apxs and the php library was installed to
/usr/local/php. However, when I set my "error_reporting" setting to be
"E_ALL", notices are still not getting reported. The perms on my file
are 664, with owner root and group root. The php.ini file is located
at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem
to be having an effect? ...
|
by: sandy |
last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory',
within my class Directory (Can you already smell disaster?)
Each Directory can have subdirectories so I thought to put these in an
array. The application compiles but aborts without giving me any useful
information.
What I suspect is happening is infinite recursion. Each Directory
object creates an array of Subdirectories each of which has an array of...
|
by: denny1824 |
last post by:
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am getting a default error page. It is an aspx page that I am trying to view.
If I put in a fake page name it gives a different error about that fake name not existing, which means to me that it is seeing the page I want to view but is giving an error...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |