Previous Topic

Next Topic

Book Contents

Book Index

The overall design

II2LN is declared as external functions in LotusScript. The operation of the functions is controlled with the so-called Import Options. The Import Options is a set of variables controlling how the functions should process the images or URLs.

Further, the functions operate on existing documents. This is extremely important to understand. II2LN can only import or attach images to documents that already exist in the Notes database. The reason for this is that the II2LN operate strictly in the so-called back-end context, making it possible to run II2LN on a server. Besides, Lotus Notes has always had serious limitations regarding updates of the rich text fields in the front-end context, and changes tools such as II2LN make, won't be visible until the document has been closed and re-opened.

Below you see a small sample on how II2LN is declared and called in LotusScript:

The following LotusScript code declare the external function ImportImage in the VCII2LN.DLL. The code is typically placed in the (Declarations) part:

Declare Function ImportImage Lib "VCII2LN.DLL" (_
Byval pstrNotesServer As String, _
Byval pstrNotesDatabase As String, _
Byval pstrNotesUNID As String, _
Byval pstrNotesField As String, _
Byval pstrFilename As String, _
Byval pstrImportOptions As String) As Long


The LotusScript code above implies that the VCII2LN.DLL is placed in a directory specified in your PATH environment variable. Please refer to the Designer Help in Lotus Notes to see how to fully use the Declare-statement in order to specify alternative places for the DLL.

When the external function is specified, it can be called just like any other LotusScript function. Below you see the function in action:

Sub Initialize
Dim lRc As Long
lRc = ImportImage(_
"YourServerName",_
"DatabaseName.nsf",_
"UNID", _ ' The UNID
"Body",_ ' The field name
"Filename.jpg",_
"Sharpen:50;Resize:200,200")
End Sub

The sample above will import the image c:\temp\smile.jpg into the field Body in the document specified by the UNID in the specified database.

The import options specify that the image will be sharpened and resized to 200 by 200 pixels!

If ImportImage succeeds, it will return 0. All other return codes indicate an error situation.

In This Section

Function groups

Import Options

Replacable variables

See Also

What is Import Image 2 Lotus Notes ?

The main purpose

The challenges with standard Notes