J
JanAdam
I am new to VBA I need help with calling a DOS command from within a VBA 6
code. Here is an example: Suppose I need a list of files in a folder. One can
do it using DOS dir command like
Prompt:> dir drive:\path\foldername > drive:\path\list.txt
The file list.txt output file created contains all file names in foldername,
plus some other info. I have written a vba code for Word to *clean* the
list.txt file, such that it now only contains the names of files in the
foldername folder. The question I have is: can one write a stand alone
*application* or a Word addin, such that it starts with a user form in which
one can browse to a foldername as a source and say cleanlist.doc as the
output, and on closing the form, the dir command is executed, the list.txt
file cleaned with my code, and the cleaned output file placed into a
path\cleanedfile.doc file? I know how to open, create and close files from a
vba code. I do not know how to call a dos command from vba and how to make a
form with controls that allow to browse for a source and destination folders.
Any reading suggestions? Thanks,
code. Here is an example: Suppose I need a list of files in a folder. One can
do it using DOS dir command like
Prompt:> dir drive:\path\foldername > drive:\path\list.txt
The file list.txt output file created contains all file names in foldername,
plus some other info. I have written a vba code for Word to *clean* the
list.txt file, such that it now only contains the names of files in the
foldername folder. The question I have is: can one write a stand alone
*application* or a Word addin, such that it starts with a user form in which
one can browse to a foldername as a source and say cleanlist.doc as the
output, and on closing the form, the dir command is executed, the list.txt
file cleaned with my code, and the cleaned output file placed into a
path\cleanedfile.doc file? I know how to open, create and close files from a
vba code. I do not know how to call a dos command from vba and how to make a
form with controls that allow to browse for a source and destination folders.
Any reading suggestions? Thanks,