【发布时间】:2020-11-25 08:35:33
【问题描述】:
我正在尝试编写一个程序来更改和打印来自 p-Touch Brother 打印机的现有标签“label.lbx”。 但我的程序停在:
bpac.Document doc = new bpac.Document();
错误信息:
**System.IO.FileNotFoundException:** "The COM class directory for the component with CLSID {B940C105-7F01-46FE-BF41-E040B9BDA83D} could not be retrieved due to the following error: 8007007e The specified module was not found. (HRESULT exception: 0x8007007E).
我已经删除并添加了 Interop.bpac.dll 文件。项目清理和重建。将文件移至调试顺序。但这没有帮助。
有人知道为什么会出现错误消息吗?
我的代码:
string path = @"C:\Users\source\repos\LabelTool\label.lbx";
bpac.Document doc = new bpac.Document();
doc.Open(path);
doc.SetPrinter("Printer", true);
doc.GetObject("ReplacePlace").Text = textBox1.Text;
doc.StartPrint("", bpac.PrintOptionConstants.bpoDefault);
doc.PrintOut(1, bpac.PrintOptionConstants.bpoDefault);
doc.EndPrint();
doc.Close();
【问题讨论】: