Parse

Applies to: SharePoint Foundation 2010

Parses the specified document and writes the document properties that it extracts to the specified property bag.

HRESULT Parse(
   ILockBytes *pilb,
   IParserPropertyBag *pibag,
   VARIANT_BOOL *pfChanged
);

Parameters

pilb

[in] The document to be parsed.

pilbag

[in] The property bag object into which the parser writes the document properties.

pfChanged

[out] Whether the parser has changed the document. True if the parser has changed the document, False if it has not.

Return Value

The parser methods return typical HRESULT values. In general, the parser should return a positive OK value when successful or a negative FAIL value when unsuccessful.

Remarks

Microsoft SharePoint Foundation prepopulates the property bag object that it passes in the pilb argument with any document properties that are already specified for the document.

After the parser executes this method, SharePoint Foundation accesses the property bag and determines which properties match the columns for the document. It then promotes those properties, or writes the document property value to the matching document library column. SharePoint Foundation promotes only the properties that match columns applicable to the document.

SharePoint Foundation also stores the entire document property collection in a hash table; this hash table can be accessed programmatically by using the SPFile.Properties properties.

If the parser alters the document, as specified by the pfChanged argument, SharePoint Foundation uploads the updated document to the document library.

For more information, see Document Property Promotion and Demotion.

See Also

Concepts

Custom Document Parsers

Document Property Promotion and Demotion

Document Parser Interface Overview