Previous Topic

Next Topic

Book Contents

Book Index

ImportImage

Description:

This is one of the core functions in II2LN and it import the specified image as a Notes Embedded Image.

Declaration:

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

Parameters:

Param

Description

pstrNotesServer

The Domino server or blank ("") if local.

The output from the NotesDatabase property Server works fine, such as:

db.Server

pstrNotesDatabase

The filename of the database containg the document. Either the relative filename (such as mail\tester.nsf) or the extact filename (such as c:\program files\lotus\notes\
data\mail\tester.nsf) may be used.

The output from the NotesDatabase property FilePath works fine, such as:

db.FilePath

pstrNotesUNID

The Document Unique ID of the document to work on. Note that this should be the textual string of the UNID.

Note that you can use the NotesDocument's property UniversalID, such as:

doc.UniversalID

pstrNotesField

The field name of the rich text field to import the image into.

pstrFilename

The full filename of the image to import.

Starting from version 1.4 of II2LN you can also specify any http:// or file:// URL in this parameter

pstrImportOptions

Optional import options to control how the image is processed and imported

Returns:

The return code as Long. A return code of zero means successful import. See below for other return codes.


Usage:

Sub Initialize
Dim lRc As Long
lRc = ImportImage(_
"YourServerName",_
"Database.nsf",_
"UNID",_
"RichTextFieldName",_
"C:\Temp\Smile.jpg",_
"Sharpen:50;Resize:200,200")
End Sub

See this example for a complete demonstration of ImportImage

Notes:

Note that ImportImage can import the image either into a sole rich text field, or it can replace an already existing variable in the rich text field. Read more about this feature here.

All import logic is controlled by the import options, read more about what import options are here, or see a list of available import options here.

Return Codes:

Code

Description

1001

Licence error. This PERSONAL license can only be used with Notes ID Name/Organisation. The installed license is locked to only one Notes user ID.You have probably tried to run II2LN with another Notes user ID.

1002

Licence error. This PERSONAL licence for N concurrent users can only be used within organization X. The installed license is limited to work on one Notes organization, You have probably tried to run the personal version of II2LN on another Notes organization.

1003

Licence error. This SERVER licence can only be used on server X. The installed license can only be used on the specified server name. Both servername and organization must match.

1004

Licence error. This SITE licence can only be used within organization X. The installed site-license can only be used with in the specified organization.

1005

Licence error. This DATABASE licence can only be used on database X. The licence is tied to a specified database, and it seems like you are using the component on another database

2001

There is an unspecified error with the internal DXL processing in II2LN. Please refer to the appendix about Troubleshooting.

2002

The specified image is not a valid image. This error code will only be given if the import option StrictImageVerification is turned on.

ANY OTHER

II2LN may return a whole set of errors. If errors occur, they will be logged in either the VCII2LN_Log field or in the optionally specified log file. See appendix about Troubleshooting for more info on logging

Introduced in version:

1.0.0.0

See Also

Functions

Identification functions

ImportImageAsResource

AttachImage

ProcessImage

GetImageDimension

GetImageFromClipboard

GetTIFFFrameCount

GuessImageFormat

GuessImageFormatStrict