When executing word in CreateProcess, You need to specify a parameter D: \ aaa.doc for the external program. If this document is an item in stringlist, how should we write it? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061106182559294.html
VaR
X: integer;
Wordlist: tstringlist;
Si: startupinfor;
Pi: process_information;
Begin
Wordlist: = tstringlist. Create;
Wordlist. Add (....);
For X: = 1 to wordlist. Count do begin
CreateProcess (nil, 'd: \ Office \ word.exe wordlist [x-1] ', nil, nil, false, 0, nil, nil, Si, Pi );
End;
End;
In half a day, it is always unsuccessful. How can we use the parameter "word.exe" in "makeup wordlist" and" docdocument "to pass the parameter?
try this way:
var
X: integer;
wordlist: tstringlist;
Si: startupinfor;
Pi: process_information;
srun: string; // defines a temporary variable
begin
wordlist: = tstringlist. create;
wordlist. add (....);
for X: = 1 to wordlist. count DO
begin
srun: = 'd: \ Office \ word.exe '+ wordlist [x-1];
CreateProcess (nil, pchar (srun), nil, nil, false, 0, nil, nil, Si, Pi);
end;