Link to home
Start Free TrialLog in
Avatar of dzienis
dzienis

asked on

Incorrect argument type in NotesUIView.Print(1)

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
Avatar of qwaletee
qwaletee

There are three different "object model" external interfaces:
1) Java
2) OLE Automation, since R4
3) COM, since R5.0.2b

The COM interface only includes "back end" classes (NotesSession on down), but is a complete interface, with full parameter dexcriptions and early binding.

The OLE Automation interface uses the client even for back-end objects, and only supports late binding, but does support the front-end objects (NotesUiWorkspace on down).

So, you are stuck with the late binding.

Now, not all of the object facilities are available in every version.  There are many "internal" classes/methods/properties that are nly suported in LotuSccript, not COM or OLE, and there are actually some that are only supported in COM.  NotesUiView is clearly labelled as not supported in COM.  I have no idea if it is actually supported in OLE Automation.

Assuming it is supported, the next problem you may be running is the form of your call.  Try
    CALL NotesUiView.Print(1)
or
    NotesUiView.Print 1

You seem to have mixed the two together.  Without the CALL, the parentheses are not part of the syntax, so they are interpreted as just forming an expression, "(1)", which is then passed as a parameter, as opposed to an expression "1" (no parentheses), which is passed as-is.

Since you have changed it from 1 to (1), there may be some casting issues causing it to not be seen as an integer.  But that's just conjecture.

It could also simply be a bug.
Give this a shot ..

NotesUIView.Print 1

or

Call notesuiview.print(1)

~Hemanth
Avatar of dzienis

ASKER

Since I am using VB.NET only one notation is allowed  - print(1) and I think it does not metter whether I use "call" or not. I have tried hundreds of approaches, with different types of parameters and different ways of calling the method. I already found clear explanation that NotesUiView does not supported by COM so I cannot use early binding, but it is supported by OLE Automation with late binding, and it even works without parameters, but I could not pass any parameters to it to suppress print dialog.
ASKER CERTIFIED SOLUTION
Avatar of pgloor
pgloor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial