Sar1973
asked on
Syntax of shell function with multiple parameters.
Does anybody know how can I convert the following content of a .bat file to the argument of a Shell function? In other words, I want to call/execute this exact content with VBA:
C:\Programs\omniformat\omn iformat.ex e "C:\Mailing\myLetter.doc" "JPG"
Thanx.
C:\Programs\omniformat\omn
Thanx.
ASKER
The only problem is that the instructions included in the batch file change for each document I would like to merge. Could you then provide a code to generate batch files?
Sar1973,
<the instructions included in the batch file change for each document I would like to merge.>
OK, this is new information.
What are these "instructions" that will change?
Now I will presume that the Path/Filename (C:\Mailing\myLetter.doc) and the Extension (JPG) will be the "Instructions" that will be changing.
I will also presume that these values are listed in a two textboxes on your form.
So you would use something like this:
Shell "C:\Programs\omniformat\om niformat.e xe" & " " & me.txtYourFilePathAndFullF ileName & " " & me.txtFileExtension
So in this case: C:\Mailing\myLetter.doc
is stored in txtYourFilePathAndFullFile Name
...and: JPG
is stored in txtFileExtension
JeffCoachman
<the instructions included in the batch file change for each document I would like to merge.>
OK, this is new information.
What are these "instructions" that will change?
Now I will presume that the Path/Filename (C:\Mailing\myLetter.doc) and the Extension (JPG) will be the "Instructions" that will be changing.
I will also presume that these values are listed in a two textboxes on your form.
So you would use something like this:
Shell "C:\Programs\omniformat\om
So in this case: C:\Mailing\myLetter.doc
is stored in txtYourFilePathAndFullFile
...and: JPG
is stored in txtFileExtension
JeffCoachman
ASKER
Found it: it needs Chr(34) instead of & " ". Thanx.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I agree, sorry. It's only that I'm getting mad on some code in these days, hope you understand.
< hope you understand.>
Yep.
;-)
Jeff
Yep.
;-)
Jeff
You should be able to simply run the batch file from the shell command.
So leave your batch file as is, and "call" it with the shell command from your VBA code.
Like so:
Shell "C:\YourFolder\YourBatchFi
JeffCoachman