Declaration
Automation:
void  Write ( [in]   byte  pData, [in]   ulong  off, [in]   uint  write_size) ;
Native (C++):
HRESULT  Write ( [in]   unsigned char *  pData, [in]   unsigned __int64  off, [in]   unsigned long  write_size) ;
Parameters
pDataPointer to the buffer containing the data to be written to the file.offWrite offsetwrite_sizeTotal number of bytes to write
Return Value
S_OK or standard OLE error code.
Remarks
Writes data to a document. The written data overwrites document's existing data and may also increase the file's size if it overlaps the current file's size. Write always creates a new operation in document's operation history. Complexity: constant-time.
Examples

Writing Data

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

See Also