Windows 7 环境中的 PowerBuilder 10.5,使用 MS Office 2010 进行 ole 控制时出现网络打印机问题

发布于 2024-11-16 18:25:06 字数 577 浏览 0 评论 0原文

我进行了所有以下迁移,

  1. 从 PowerBuilder 9 到 PowerBuilder 10.5
  2. Windows XP 到 Windows 7
  3. MS Office 97 和 MS Office 2003 到 MS Office 2010

从 PowerBuilder 应用程序,我们正在执行以下操作

  1. 邮件合并文档
  2. 打印文档
  3. 通过电子邮件发送附件,

例如该功能是自动化的,我们正在从应用程序中使用。这里我们使用 OLE 控件来处理 MS Office 功能。

问题是

在它开始工作前 3 周,我的意思是下面的代码。

ole_1.object.application.ActivePrinter = i_s_letterenvelops_printer

之后他们将服务器从一个位置转移到另一个位置。

而且我也不知道我的开发机器。

在这种情况下,我该如何处理?

请帮我解决这个问题。

谢谢!

I did all the follwoing migartion,

  1. from PowerBuilder 9 to PowerBuilder 10.5
  2. Windows XP to Windows 7
  3. MS Office 97 and MS Office 2003 to MS Office 2010

From the PowerBuilder application, we are doing the following things

  1. MailMerging the documents
  2. Printing the documents
  3. Emailing with attachments

like this functionalities are automated and we are using from the application. Here the OLE control we are using to handle MS Office functionalities.

The problem is

3 weeks before it was working i meant the below code .

ole_1.object.application.ActivePrinter = i_s_letterenvelops_printer

after that they Shifted the servers to one location to another location.

and also i didn't know about my development machine..

In this case, how can i handle this ?

Please help me about this.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦与时光遇 2024-11-23 18:25:06

也许打印机名称已更改?例如,我的网络打印机名称类似于 SERVER-NAME 上的 PRINTER-NAME。另请注意,它们区分大小写。在我们的应用程序中,我们在尝试使用打印机名称之前检查它是否存在。如果不存在,我们会显示一条消息,告诉用户联系该打印机的帮助台。您可以使用 PrintGetPrinters 获取可用的打印机名称。

添加20110629:
对于应用程序来说,网络打印机名称类似于 \\SERVER-NAME\PRINTER-NAME
一种快速检查方法是将以下行放入您的应用程序中:

messagebox("PrintGetPrinters", printgetprinters(), Information!, OK!)

Perhaps the printer names have changed? For example, my network printer names are like PRINTER-NAME on SERVER-NAME. Also note they are case-sensitve. In our application we check if the printer name exists before we try to use it. If it's not there we show a message telling the user to contact the helpdesk about that printer. You can get the available printer names with PrintGetPrinters.

Added 20110629:
To the application the network printer name looks like \\SERVER-NAME\PRINTER-NAME.
A fast way to check is to put this line in your application:

messagebox("PrintGetPrinters", printgetprinters(), Information!, OK!)

桃酥萝莉 2024-11-23 18:25:06

我的情况是,网络组最近将打印机配置文件更改为基于网络,这导致应用程序无法创建 PDF 文件。
我的电脑上的打印机列表看起来和以前一模一样:

Send To OneNote 2010    winspool    nul:
Microsoft XPS Document Writer   winspool    Ne00:
CutePDF Writer  winspool    CPW2:
Adobe PDF   winspool    Ne01:
\\otwww001\T01-001-HPLaserJet-4050  winspool    Ne02:

这些打印机名称存储在一个数组中。问题在于,一个字符 (13) 被神奇地添加到了 Adob​​e PDF 行的末尾。为了解决这个问题,我在添加打印机之前删除了 char(13)(如果存在)。

if right(ls_CurrentPrinter,1) = char(13) then 
  ls_CurrentPrinter =left(ls_CurrentPrinter,len(ls_CurrentPrinter) - 1)
end if
IF LEN(ls_CurrentPrinter) > 0 THEN
 THIS.ufp_AddNewPrinter(ls_CurrentPrinter)
END IF

它解决了我的问题。

环境: - Windows 7 - PowerBuilder 12.6

My situation was that the Network Group recently changed the printer profile to a network based which caused the application could not create PDF files.
The list of printers on my PC looked exactly the same as before:

Send To OneNote 2010    winspool    nul:
Microsoft XPS Document Writer   winspool    Ne00:
CutePDF Writer  winspool    CPW2:
Adobe PDF   winspool    Ne01:
\\otwww001\T01-001-HPLaserJet-4050  winspool    Ne02:

These printer names were stored in an array. The problem was that a char (13) was magically added to the end of the Adobe PDF line. To solve the problem, I remove the char(13) if it exists before I add the printer.

if right(ls_CurrentPrinter,1) = char(13) then 
  ls_CurrentPrinter =left(ls_CurrentPrinter,len(ls_CurrentPrinter) - 1)
end if
IF LEN(ls_CurrentPrinter) > 0 THEN
 THIS.ufp_AddNewPrinter(ls_CurrentPrinter)
END IF

It solved my problem.

Environment: - Windows 7 - PowerBuilder 12.6

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文