Scanning a document under notes\web client

Hello,

i would like to create a button (available in notes client and web client) that launchs a scan (using TWAIN) and save the image to attach it in the main document.

is that possible ?

thanks for your help

Subject: scanning a document under notes\web client

This is actually across posting that I did in the R4/5 forum but it works for the Notes client:


Ok here is a full solution that does not require third party software to be purchased.

I am posting this has I spent a full day getting all the pieces from various posts in order to figure this out.


  1. Add the OCX control

Open your form in designer and select ‘Create/Object’ select:

  • Control

  • Kodak Image Scan Control

  • You might want to hide the control as user will be tempted to click on it

  1. Create a button to attach the file using the scanner control

Create the button

Add the following script:

Sub Click(Source As Button)

Const SCANFILEPATH$={C:\temp.tiff}

Const IMPORTFILETYPE$={TIFF}

Const RTFNAME$={Body}

Const SCANOBJNAME$={objscan}

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim scanner As Variant



Dim db As notesdatabase

Dim s As New notessession

Dim doc As notesdocument

Dim fileTemp As String

Dim xobject As Variant

Set uidoc = workspace.CurrentDocument 

Set doc = uidoc.document

Set db = s.currentdatabase

Set xdoc=s.DocumentContext

Call uidoc.GoToField("Body")

On Error Resume Next



Set scanner = uidoc.GetObject("Kodak Image Scan Control")

scanner.image = Cstr(doc.Body(0))

scanner.MultiPage = 1





If scanner.ScannerAvailable=True Then 

'	scanner.ShowSelectScanner

	

	scanner.image=SCANFILEPATH$

	scanner.ScanTo=2

	scanner.PageOption=6

	scanner.ShowSetupBeforeScan=False

	' Call scanner.ShowScanPreferences

	

	Kill Cstr(doc.Body(0))

	

	scanner.OpenScanner 

	scanner.StartScan

	Call scanner.CloseScanner

	Call uidoc.GoToField("Body")		

	Call uidoc.CreateObject("", "", SCANFILEPATH$)

End If

End Sub

  1. Issues I ran into:

If you have not run the scanner software on the user’s pc at least once the above script will not find a registered scanner. You have two choices you an either run the scanner software or change the line above from scanner.ShowSetupBeforeScan=False to ‘True’ but if you follow code management policies you will need to do option one