Notes OLE Automation and NotesUIView.Print

Hi folks,

I am trying to automate Notes documents printing using Notes Ole Automation. I am stuck with “Incorrect argument type: integer expected” error when calling

NotesUIView.Print(1)

No matter where I am calling this method (Delphi, VB) , no matter what type of parameter I am trying to use (all types of integer, Object, OleVariant, array) automation keep responding with “Incorrect argument type: integer expected” exception. If I do not pass any parameter the print dialog pops up and I do not need that.

NotesUIDocument.Print works fine with and without parameter but that way security dialogs may pop up.

Has anyone else succeeded in calling NotesUIView.Print through automation?

By the way, type library automatically registered with Notes 6 contains very limited descriptions of notes ole interfaces so it is impossible to use early binding. Registration of nlsxbe.dll does the trick, but has only back end classes described, no UI versions. Is there dll which I can register to have better type library for Notes front end classes? I guess it should be because a lot of examples I have seen so far use early binding.

Thank you,

Best Regards,

Alex Dzienis

Subject: Notes OLE Automation and NotesUIView.Print

Hi Alex,

Try this:

Dim g_oNotesUIWorkspace as Object

Dim oNotesUIView as Object

Dim NotesDocument as Object

Dim vResult as Variant

’ Get the notes view

Set oNotesUIView = g_oNotesUIWorkspace.CURRENTVIEW

’ Select the document

vResult = oNotesUIView.SELECTDOCUMENT(NotesDocument)

vResult = oNotesUIView.print(1)

This selects and prints the document currently selected in the view (Notes R6.5.4)