MapiContact.SaveAsync

SaveAsync(string, CancellationToken)

Saves this MapiContact to the vCard file with a default options asynchronously. The supported vCard version is 2.1

public Task SaveAsync(string filePath, CancellationToken token = default)
ParameterTypeDescription
filePathStringA vCard file name
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentExceptionfilePath is null or empty

See Also


SaveAsync(string, ContactSaveFormat, CancellationToken)

Saves this MapiContact to the specified file with a format using the default options asynchronously. The supported save format is vCard.

public Task SaveAsync(string filePath, ContactSaveFormat saveFormat, 
    CancellationToken token = default)
ParameterTypeDescription
filePathStringA vCard file name
saveFormatContactSaveFormatA save format
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentExceptionfilePath is null or empty
NotSupportedExceptionthe specified format is not supported

See Also


SaveAsync(string, ContactSaveOptions, CancellationToken)

Saves this MapiContact into file using specified save options asynchronously. The supported save options is VCardSaveOptions

public Task SaveAsync(string filePath, ContactSaveOptions saveOptions, 
    CancellationToken token = default)
ParameterTypeDescription
filePathStringA vCard file name
saveOptionsContactSaveOptionsA save options
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentExceptionfilePath is null or empty
ArgumentNullExceptionsaveOptions is null
NotSupportedExceptionsome save option is not supported

See Also


SaveAsync(Stream, ContactSaveFormat, CancellationToken)

Saves this MapiContact into the given stream with vCard format asynchronously. The supported vCard version is 2.1

public Task SaveAsync(Stream stream, ContactSaveFormat saveFormat, 
    CancellationToken token = default)
ParameterDescription
streamA stream to save to
tokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null
NotSupportedExceptionstream does not support writing

See Also


SaveAsync(Stream, ContactSaveOptions, CancellationToken)

Saves this MapiContact to the given stream using specified save options asynchronously. The supported save options is VCardSaveOptions

public Task SaveAsync(Stream stream, ContactSaveOptions saveOptions, 
    CancellationToken token = default)
ParameterTypeDescription
streamStreamA stream to save to
saveOptionsContactSaveOptionsA save options
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentNullExceptionstream or saveOptions is null
NotSupportedExceptionstream does not support writing
ArgumentExceptionincorrect saveOptions
NotSupportedExceptionsome save option is not supported

See Also


SaveAsync(Stream, CancellationToken)

Saves this MapiContact to the given stream asynchronously. The supported save format is vCard.

public Task SaveAsync(Stream stream, CancellationToken token = default)
ParameterTypeDescription
streamStreamA stream to save to.
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null.
NotSupportedExceptionstream does not support writing.

See Also