//下载相应的附件
procedure TTWebOA.DownLoadWord(sUserName,sPassword,sFileName: string);
var
filename : string;
sIP,sComputerName : String;
begin
//filename := sFileName;
filename := copy(sFileName,pos('/$FILE/',sFileName)+7,length(sFileName));
sComputerName := Copy(sFileName,Pos('http://',sFileName)+7,Length(sFileName));
ScomputerName := Copy(sComputerName,1,Pos('/',sComputerName)-1);
sIp := '192.168.0.1';
if not DirectoryExists('c:/temp') then
begin
if not CreateDir('C:/temp') then
begin
showmessage('不能创建C:/temp目录!');
wordapplication1.disconnect;
Close;
end;
end;
filename := 'C:/temp/'+filename;
//FileCreate(filename);
NMHTTP1.InputFileMode := true;
NMHTTP1.Body := filename ;
NMHTTP1.Header := 'Head.txt';
NMHTTP1.OutputFileMode := FALSE;
NMHTTP1.ReportLevel := Status_Basic;
NMHTTP1.Proxy := sIp;
NMHTTP1.ProxyPort := 80;
With NMHTTP1.HeaderInfo do
Begin
Cookie := '';
LocalMailAddress := '';
LocalProgram := '';
Referer := '';
UserID := sUserName;
Password := sPassword;
End;
NMHTTP1.get(sFileName);
end;