Declaration
Automation:
void  Read ( [out]   ref byte  pData, [in]   ulong  off, [in]   uint  read_size) ;
Native (C++):
HRESULT  Read ( [out]   unsigned char *  pData, [in]   unsigned __int64  off, [in]   unsigned long  read_size) ;
Parameters
pDataA pointer to the buffer that receives the data read from a fileoffRead offsetread_sizeTotal number of bytes to read
Return Value
S_OK or standard OLE error code.
Remarks
Reads data from a document. If requested data exceeds the current document's size, any excess bytes are filled with zeros. Complexity: constant-time.
Examples

Reading Data

C++Copy Code
// pFileDocument is initialized elsewhere
unsigned char data[256];
pFileDocument->Read(data, 1000, 256);