Platform SDK: Fax Services

IFaxServer::CreateDocument

The IFaxServer::CreateDocument method creates a FaxDoc object for a specified FaxServer object. The FaxDoc object allows a user to create and transmit a document to one or more fax recipients.

Visual Basic Reference

HRESULT CreateDocument(
  BSTR FileName,   // fax document file name
  VARIANT *retVal  // receives IDispatch pointer to FaxDoc object
);

Parameters

FileName
[in] Specifies a null-terminated string that contains the fully qualified path and name of the file that contains the fax document to transmit. The path can be a UNC path or a path beginning with a drive letter.

This parameter can contain any valid local or remote file name. The file must be a properly registered file type, and the fax server must be able to access the file.

retVal
[out] Pointer to a VARIANT structure that receives an IDispatch interface pointer to a FaxDoc object. The method returns a ppdispVal member with a VT_DISPATCH data type.

Return Values

Returns an HRESULT value indicating success or failure. If the method succeeds, it returns S_OK. Otherwise, it returns a COM-defined error code.

You should not check directly for success or failure. Use the COM SUCCEEDED and FAILED macros instead.

Remarks

The IFaxServer::CreateDocument method retrieves an IDispatch interface pointer to a FaxDoc object. A fax client application can also access the IFaxDoc interface directly by calling the IUnknown::QueryInterface method to retrieve an interface pointer. The IFaxDoc interface allows a user to set the properties for a fax document, and then transmit the document.

A fax client application should not call the CoCreateInstance function to retrieve an IFaxDoc interface pointer because it will not be instantiated correctly.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in faxcom.h.
  Import Library: Included as a resource in faxcom.dll.

See Also

Fax Service Client Application Programming Interface Overview, Fax Service Client API Interfaces, IFaxServer, IFaxDoc, IUnknown::QueryInterface