【发布时间】:2014-02-26 04:25:36
【问题描述】:
我使用以下代码打开一个 MS Word 文档:
try
{ Open the document}
WrdApp := CreateOLEObject('Word.Application');
wrdDoc := 'temp.docx');
// Wrddoc.SaveAs('temp2.docx');
except
on E: Exception do
begin
E.Message := 'Could Not Execute MS WORD!';
raise;
end;
end;
然后使用wrdapp.Printout打印出来
我有一个组合框,其中包含使用代码的计算机中的打印机名称列表:
Combobox32.Items.Assign(Printer.Printers);
如何将 MS Word 中的活动打印机更改为组合框中选定的打印机,以便当我调用 wrdapp.Printout 时,它将从组合框中选定的打印机打印?
提前感谢您的帮助。
【问题讨论】:
-
参见Application.ActivePrinter,但是看到那里的注释(它实际上改变了系统默认打印机)。