WIA.Scan
--------

Transfers data from the given item to the application.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WIA](component_WIA.md) | [6.5](newinversion65.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "WIA.Scan"; Item ) 

**MBS**( **"WIA.Scan";** /\* Transfers data from the given item to the application. \*/  
**$Item**) /\* The item of current device to query.  
For a scanner this is typical Flatbed or Feeder.  
see [WIA.ListItems](WIAListItems.md)e.g. "Flatbed" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Item | The item of current device to query.   For a scanner this is typical Flatbed or Feeder.   see [WIA.ListItems](WIAListItems.md) | "Flatbed" |

### Result

Returns OK or error.

### Description

Transfers data from the given item to the application.  
We normally put the files on successful transfer into temp file and you get paths back from [WIA.Image](WIAImage.md) function.  
  
If the document feeder fails to supply an image, the returned path to image file will be empty.  
### Examples

Scan via flatbed:

 MBS ( "WIA.Scan"; "Flatbed" )  
Scan via feeder:

 MBS ( "WIA.Scan"; "Feeder" )  
Scan duplex from document feeder:

 # switch on duplex mode   
Set Variable \[ $r ; Value: MBS ( "[WIA.SetItemPropertyValue](WIASetItemPropertyValue.md)"; "Feeder"; "Document Handling Select"; 4 ) /\* 1 = feeder 2 = flatbed 4 = duplex 8 = front first 16 = back first 32 = front only 64 = back only 128 = next page 256 = preferred 512 = auto advance see https://docs.microsoft.… \]   
\#   
\# Scan via document Feeder   
Set Variable \[ $r ; Value: MBS ( "WIA.Scan"; "Feeder") \]   
\#   
\# Result can be OK or Cancel and in both cases some images may be there   
If \[ $r ≠ "OK" \]   
 Show Custom Dialog \[ "Scan Result" ; $r \]   
Else  
 Perform Script \[ Specified: From list ; “Import Images” ; Parameter: \]  
End If  
### See also

- [WIA.Image](WIAImage.md)
- [WIA.ListItems](WIAListItems.md)
- [WIA.SetItemPropertyValue](WIASetItemPropertyValue.md)

### Release notes

- **Version 8.3**
    - Changed [WIA.Scan](http://www.mbsplugins.eu/WIAScan.shtml) to handle multiple pages better.

### Example Databases

- [DynaPDF/Scan with WIA to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Scan%20with%20WIA%20to%20PDF.shtml#8ScriptAnchor_)
- [Win Only/Scanning/WIA Scan](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Scanning/WIA%20Scan.shtml#8ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 20 - Scan and Recognize](https://www.mbsplugins.de/archive/2024-12-20/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [Create PDF from scanned images and skip blank pages](https://www.mbsplugins.de/archive/2019-03-13/Create_PDF_from_scanned_images/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.3pr2](https://www.mbsplugins.de/archive/2018-06-18/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.5pr9](https://www.mbsplugins.de/archive/2016-12-05/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 28th November 2016 , last changed 11st February 2019

  
[WIA.ListItems](WIAListItems.md) - [WIA.SelectDeviceDialog](WIASelectDeviceDialog.md)

[HTML Version](WIAScan.shtml)