ListManager.ExportToFile Method (PIA)

Use this method to export a Mailing list to a text file.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub ExportToFile(listID As Object,
 fileName As String,
 bUnicode As Integer,
 bOverwrite As Integer,
 bAsync As Integer,
 Optional ByRef pvarOpID As Object)

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public void ExportToFile(objectlistID,
 stringfileName,
 intbUnicode,
 intbOverwrite,
 int bAsync,
 ref objectpvarOpID);

Parameters

[Visual Basic .NET]

  • listID
    An Object that contains the ID or name of the list to be exported.
  • fileName
    A String that contains the name of the file.
  • bUnicode
    An Integer that specifies the character format of the export file. A value of 1 indicates that Unicode characters should be used. A value of 0 indicates that the current system character set should be used.
  • bOverwrite
    An Integer that specifies whether to overwrite the data in the export file, if it exists. A value of 1 indicates that the data should be overwritten. A value of 0 causes the method to fail if the file exists.
  • bAsync
    An Integer that specifies whether the creation operation is performed synchronously or asynchronously. A value of 1 indicates asynchronous processing.
  • pvarOpID
    An optional Object used to return an Operation ID.

[C#]

  • listID
    An object that contains the ID or name of the list to be exported.
  • fileName
    A string that contains the name of the file.
  • bUnicode
    An int that specifies the character format of the export file. A value of 1 indicates that Unicode characters should be used. A value of 0 indicates that the current system character set should be used.
  • bOverwrite
    An int that specifies whether to overwrite the data in the export file, if it exists. A value of 1 indicates that the data should be overwritten. A value of 0 causes the method to fail if the file exists.
  • bAsync
    An int that specifies whether the creation operation is performed synchronously or asynchronously. A value of 1 indicates asynchronous processing.
  • pvarOpID
    A reference to an object used to return an Operation ID.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

[Visual Basic .NET]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
&H8C40000A The specified file path is not valid.
&H8C400009 The List Manager service does not have permission to open the specified file. Check the permissions for the List Manager service account against the permissions for the file.
&H8C400010 The specified file cannot be created because it already exists.
&H8C400016 The network share does not exist and a full path was not specified for the file.
&H8C400008 The specified list is currently busy with another operation.
&H8C40001D The specified list is in a FAILED state and may not be used for the operation.
&H8C400006 The specified list does not exist.
&H8C400011 The operation requires a Mailable list and the specified list is not a Mailable list.
&H8C40000B The operation was canceled.
&H8C400003 Error while executing SQL/ADO operation.
&H80040007 The ListManager object has not been properly initialized.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0x8C40000A The specified file path is not valid.
0x8C400009 The List Manager service does not have permission to open the specified file. Check the permissions for the List Manager service account against the permissions for the file.
0x8C400010 The specified file cannot be created because it already exists.
0x8C400016 The network share does not exist and a full path was not specified for the file.
0x8C400008 The specified list is currently busy with another operation.
0x8C40001D The specified list is in a FAILED state and may not be used for the operation.
0x8C400006 The specified list does not exist.
0x8C400011 The operation requires a Mailable list and the specified list is not a Mailable list.
0x8C40000B The operation was canceled.
0x8C400003 Error while executing SQL/ADO operation.
0x80040007 The ListManager object has not been properly initialized.

Remarks

If the list is a Mailable list but not a Mailing list, a temporary Mailing list is created and then exported.

If an absolute file path and name are not specified, ListManager exports the file relative to a root folder named CommerceLists on the local computer running the ListManager resource. If the folder does not exist, an error is returned.

ListManager exports the file in the following format. The is Message Format field is an integer, all other fields are strings and enclosed in double quotation marks.

   <Mail-to address>,<User ID>,<Message Format>,<Locale>,
   <Source URL><cr><lf>

The parameter pvarOpID contains valid data only if the export operation is performed asynchronously.

[Visual Basic .NET]

Example

oListManager.ExportToFile ("{2B544800-4169-4C49-8713-1B794078B4C9}", _
 "Tequila.csv", 0, 1, 0)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: listmanagerlib (in listmanagerlib.dll)

See Also

ListManager Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.