WriteToFile Method (Field Object)

The WriteToFile method saves the field value to a file in the file system.

Syntax

objField.WriteToFile(fileName)

objField
Required. The Field object.
fileName
Required. String. The full path and file name for the saved field, for example C:\DOCUMENT\BUDGET.XLS.

Remarks

The WriteToFile method writes the string or binary value of the Field object to the specified file name. It overwrites any existing information in that file.

WriteToFile is not supported for simple types, such as vbInteger, vbLong, and vbBoolean. Microsoft® Visual Basic® provides common functions to read and write these base types to and from files. The WriteToFile method fails if the Type property of the Field object is not vbString or vbBlob.

MAPI properties of type PT_BINARY are represented in a hexadecimal string format by CDO but written to persistent storage in counted binary format. Comparison operations on the Value property and the actual contents of the file can return "not equal" even when the values are equivalent.

In addition, support for types can vary among providers. Not all providers support both the vbString and vbBlob property types.

See Also

ReadFromFile Method (Field Object)