You are here: Programmers Reference > Programmer's Reference > Document > DocumentNumber

Document.DocumentNumber property

Read-Write property. This is writable only at the ScanError event when the document could not be identified by ScanTools, and your solution allows for entering the correct document number.

For successfully scanned documents, it is 1-based ordinal of the document definition within the application definition. This number is also the same as the one written to the NCS Header within the output record as a 3-byte ASCII string. For example, document number 1 is written as 001.

NOTE: As a best practice, ensure that Document.DocumentNumber is > 0 before accessing other members of the Document interface. This is especially important at the ScanError event.

The only time you write to this property is to programmatically identify an unscannable document. What constitutes an unscannable document is solution specific. Typically, you should ask the operator to retry scanning the sheet a few times before deeming it unscannable. ScanTools considers one or more of the following conditions as unscannable:

The following are not opportunities for specifying the document number programmatically:

You should set this property only for the first sheet of a document that was not identified correctly by ScanTools and you want to treat it as unscannable. Be sure to set a value in the range 1 to number-of-documents per the application definition. If the document has a litho-code, then you must also write the Document.Lithocode property.

For a sheet that is deemed unscannable and is not the first sheet in the document, the document is already identified and the DocumentNumber property will report the correct value. There is no need to write to the DocumentNumber or Lithocode properties.

For the first sheet, call ScanningManager.SetScanErrorResolution with a parameter of L_SCANERROR_RESOLUTION_IGNORE_ERROR to make your document identification effective. The second sheet error resolution should be L_SCANERROR_RESOLUTION_RESUME.

Valid

See ScanEventArgs and ScanningManager Events Valid Combinations.

IDL

propget, HRESULT DocumentNumber([out, retval] long* pVal);

propput, HRESULT DocumentNumber([in] LONG DocumentNumber);

Values

0

Value of zero is assigned at the DocInit event (read-only)

-1

Indicates error; as follows (read-only):

  • sheet was scanned but could not be identified by ScanTools (unknown form ID marks, or timing marks not found)
  • sheet not scanned due to scanner hardware error or hopper empty

001 – 255

Valid document number as defined in ScanTools application definition

Exceptions

While writing:

Scanning Services Exceptions

 

 

See Help on Help for additional information on using this help file.

See Scantron Technical Support for additional information on technical support and training options.

See the ScanTools Suite System Requirements for further details on hardware and software requirements.

ScanTools is a suite of products; the specific information you want may appear in the help for a different module. If you don't find what you're looking for here, try one of the following:

 

Scantron Corporation

Customer Service (forms, products, and services):

1-800-SCANTRON (722-6876)

www.scantron.com

Technical Support:

1-800-445-3141

support@scantron.com

Copyright © 1998-2012 Scantron Corporation. All rights reserved. Use permitted only under license. www.scantron.com. No part of the Help or user guides may be reproduced in any form, or by any means, without express permission from Scantron Corporation.

LINKS TO THIRD PARTY SITES

This help system may contain links to third party websites ("Linked Sites"). The Linked Sites are not under the control of Scantron and Scantron is not responsible for the content of any Linked Site, including without limitation any link contained in a Linked Site or any changes or modifications to a Linked Site. Scantron is not responsible for web casting or any other form of transmission received from any Linked Site. Scantron provides Users with the ability to link the Assessment System to the Linked Sites as a convenience to you, and the inclusion of any link does not imply endorsement by Scantron of the Linked Site or any association with its operators.