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

Take a file as argument and save it under a specific folder.

Status
Not open for further replies.

poli13

MIS
Jun 25, 2003
8
US
Hi,

I'm writing a program which is supposed to take a file as argument (the output from an HP Digital Sender 9100C) and based on some if...else conditions saves the file under a specific folder. How can I pass the argument to the program and what is the command to save the file???

Thanks a lot for your help.
mike
 
Take a look at the Command function, and the Name commad.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I tried the:

Name dataFile As "c:\0\" & salesOrder & ".pdf"

---where dataFile is declared under General as:

Private dataFile As String

--- but I keep getting a File not found error. I can see that the value goes to <Out of context> under watches, but I don't know why. Am I missing anything?

thanks again,
mike
 
If dataFile is just a string, you set it's value like:
dataFile = &quot;c:\0\&quot; & salesOrder & &quot;.pdf&quot;

When do you get the file not found error and what is the value of dataFile right before that error? You can use a watch to get that, or just make a:
MsgBox dataFile
Right before you use it.
 
I wrote the program so that dataFile was selected by the user from a FileListBox, but my boss wants to have the file passed as an argument to the program. I want to call the program from a batch file with the

MyApp %1

command. The %1 is a pdf file with a generic name. I go through few if else conditions and based on the user's answers I want to save the %1 file under a diferent name under a folder on the server. Do I have to pass %1 to a variable and then just use name ... as to save it to the location that I want?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top