当前位置:主页>销售管理软件> 列表

delphi中打印文件 找记账软件哪个好

库存管理软件版1楼: 程序中要实现这样一个函数,PrintAttachFile(file_path:String)
file_path是本地文件路径,文件可能是.doc,.xsl,.txt,bmp,jpg等,输入file_path,打印机直接打印,不希望有应用程序弹出(如word、excel等)。
各位,有什么好的方法?请指教,俺的200分全部奉送。
我的QQ:19176572,暗号:delphi

2楼: 急切求教,各位兄弟指导一下方向。。。 如记账软件哪个好

3楼: 再杀死word/excel进程就行

4楼: procedure TMainForm.killme(filename:string);
var
FSnapshotHandle:THandle;
FProcessEntry32:TProcessEntry32;
Ret:BOOL;
ProcessHndle:THandle;
ProcessID:integer;
temp:string;
flag:hwnd;
begin
FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);
Ret:=Process32First(FSnapshotHandle,FProcessEntry32);
ProcessID:=FProcessEntry32.th32ProcessID;
while Ret do
begin
temp:=ExtractFileName(FProcessEntry32.szExeFile);


if temp=filename then
begin
flag:=openprocess(process_terminate,false,FProcessEntry32.th32ProcessID);
terminateprocess(flag,0);
end;
Ret:=Process32Next(FSnapshotHandle,FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
ProcessHndle:=OpenProcess(PROCESS_VM_WRITE,false,ProcessID);
CloseHandle(ProcessHndle);
end;

5楼: 如果用户本来自己就打开了word或excel,在程序杀掉word进程,会不会误杀?

另外,怎样调用word和excel打印一个文档?用createOleObject启动word或excel后,用什么方法打印?

6楼: 1.函数有参数,不会误杀
2.ole控件有自带print方法可使用,非常方便

库存管理软件版7楼: 帮顶!

╭=========================================╮

80G海量源代码,控件,书籍全免费狂下不停!

http://www.source520.com

╰=========================================╯

8楼: 多人接受答案了。