PowerBuilder 10.5 on Windows 7 environment, Network printer issue with ole control using MS Office 2010
I did all the follwoing migartion,
- from PowerBuilder 9 to PowerBuilder 10.5
- Windows XP to Windows 7
- MS Office 97 and MS Office 2003 to MS Office 2010
From the PowerBuilder application, we are doing the following things
- MailMerging the documents
- Printing the documents
- 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开发者_如何学JAVA 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!
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!)
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
精彩评论