我在DELPHI中运行下例代码时出现了标题上的错误:
SaveDialog1.InitialDir:=ExtractFilePath(Application.ExeName)+'out_file';
SaveDialog1.Execute;
self.Refresh;
filename:=savedialog1.FileName;
if length(filename)=0 then
begin
application.MessageBox(' 没有选择统计文件的存储位置,不能保存统计的数据! ','提示框',mb_ok);
exit;
end;
WordApp:=CreateOleObject('Word.Application');
WordApp.Visible:=True;
WordDoc:=WordApp.Documents.Add; //画第一个矩形框
worddoc.SHAPES.AddTextbox(Orientation:=1, Left:=90, Top:=70, Width:=414, Height:=220);
WordDoc.saveas(filename);
WordDoc.Close;
WordApp.Quit;
application.MessageBox(' 输出成功! ','提示框',mb_ok);
我在调用WORD时出现了:‘消息筛选器显示应用程序正在使用中'的错误提示.
我任务管理器中有一个WORD的进程但不是我这个程序的?
我以为有宏病毒用瑞星也没杀到。
请有经验的高手指点一下能解决这个问题的方法!
SaveDialog1.InitialDir:=ExtractFilePath(Application.ExeName)+'out_file';
SaveDialog1.Execute;
self.Refresh;
filename:=savedialog1.FileName;
if length(filename)=0 then
begin
application.MessageBox(' 没有选择统计文件的存储位置,不能保存统计的数据! ','提示框',mb_ok);
exit;
end;
WordApp:=CreateOleObject('Word.Application');
WordApp.Visible:=True;
WordDoc:=WordApp.Documents.Add; //画第一个矩形框
worddoc.SHAPES.AddTextbox(Orientation:=1, Left:=90, Top:=70, Width:=414, Height:=220);
WordDoc.saveas(filename);
WordDoc.Close;
WordApp.Quit;
application.MessageBox(' 输出成功! ','提示框',mb_ok);
我在调用WORD时出现了:‘消息筛选器显示应用程序正在使用中'的错误提示.
我任务管理器中有一个WORD的进程但不是我这个程序的?
我以为有宏病毒用瑞星也没杀到。
请有经验的高手指点一下能解决这个问题的方法!
你要关掉word就好了,呵呵。就是因为这个word打开了,所以没有办法启动程序,不是病毒的问题。
begin
self.Refresh;
filename:=savedialog1.FileName;
end;