NotesUIDocument Print problem

I have created an Action button on the Memo form in my mail file (which is based on the StdR85Mail template). The idea is to automatically print email messages to a defined printer without having to go through the Print dialog.

Button code is as follows:

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Call ws.CurrentDocument.Print(0, , , ,“PDF Batch”)

End Sub

When I open a basic text email the button works and printing occurs without popping up the Print dialog (as expected).

However, if I try to use the button on an external email containing anything other than basic text the Print dialog always pops up (unexpected).

If I then put the same external email into Edit mode, the button then does print correctly without the Print dialog.

I’m not sure exactly what the trigger is for external emails to print with/without the dialog, but the help tells me that using the UIDoc.Print

“If one or more parameters are specified, automatically prints the document”

Any clues?

Subject: Same problem with 8.5.2

Hi,

Has it been any solution to that? I also have this frustrating problem with 8.5.2. I’m using the NotesUIDocument.print function to print to a PDF printer when a user presses a button. With 8.5, we didn’t notice any problem. But with 8.5.2 I have the same problem metionned above. Maybe a coincidence.

On some documents, I can see the print dialog popping up and crashing my automated process. I’m using these options to call the print function:

Call uiws.CurrentDocument.Print(1,0,0,False,“PDFCreator”)

As metionned above, the help document says that there shouldn’t be any dialog when using at least one parameter.

Is there any fix planned for this bug?

Thanks,

Carl

Subject: Same problem with 8.5.1 FP5

Hi, I encountered the same behaviour in 8.5.1 FP5,are there any solutions?

Subject: solution for older Notes versions, too…try a different PDF printer.

I found Bullzip PDF printer years ago as a PDF alternative. Lately, I was able to find a document that the Excel VBA guys use to automate the printing. I adapted it for Lotus Documents in the UI with older Notes version.

The Bullzip drivers allows you to define an object with settings that suppresses the pop-up. If it is selected as the default printer, the uidoc.print(1) seems to work well. Otherwise, you will have to use later version of Notes to select the print driver (or use some external calls to W32 DLL for printer selections).

If helpful, the following seems to work well for me, if you install the Bullzip PDF printers and use it with Notes:

'...get uidoc...and set sFileName



Dim oPrinterSettings as variant

Dim oPrinterUtil as variant



Set oPrinterSettings = createobject("Bullzip.PdfSettings")

Set oPrinterUtil = createobject("Bullzip.PdfUtil")



oPrinterSettings.Printername = oPrinterUtil.DefaultPrintername 	



oPrinterSettings.SetValue "Output", sFileName

	

oPrinterSettings.Printername = oPrinterUtil.DefaultPrintername 	

oPrinterSettings.SetValue "ConfirmOverwrite", "no" 

oPrinterSettings.SetValue "ShowSettings", "never" 

oPrinterSettings.SetValue "ShowPDF", "no" 

oPrinterSettings.WriteSettings True 

	

	

Call uidoc.print(1)

-Kyle Huang

Subject: There are 2 solutions

1 - This bug does not occur if you use nlnotes.exe (avoid the loading of eclipse). Notes gets faster and lighter. The only problem is that it will not have support for composite applications.

2 - Capture the window and treat it inside windows. It is a little tricky. I started doing this, but stopped because my client uses nlnotes. Up to now, my code wait for the print window to appear, and then SendKey to it. In C, with Windows api, you should be able to grasp the InitDialog message (opening the printer yourself and returning it’s value), but it is not easy to do.

Subject: uidoc.Print

I am having the same problem …I would like to automate the printing in the notes it works fine when i say

uidoc.Print(0,0,0,False) in old versions

but some times (randomly i gets a pop up to select the file name which should not happen and my PDF driver is taking care of that)

Any LUCK / Suggestions on this .