Share via


SPFile.SendToOfficialFile-Methode (String, String)

Sendet die Datei an einen Datensatz-Repository und gibt den Namen eines Datensatztyps routing.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function SendToOfficialFile ( _
    recordSeries As String, _
    <OutAttribute> ByRef additionalInformation As String _
) As OfficialFileResult
'Usage
Dim instance As SPFile
Dim recordSeries As String
Dim additionalInformation As String
Dim returnValue As OfficialFileResult

returnValue = instance.SendToOfficialFile(recordSeries, _
    additionalInformation)
public OfficialFileResult SendToOfficialFile(
    string recordSeries,
    out string additionalInformation
)

Parameter

  • recordSeries
    Typ: System.String

    System.String -Wert, der den Namen eines Datensatztyps routing enthält.

  • additionalInformation
    Typ: System.String

    Die Rückgabe dieser Methode enthält eine System.String , die detaillierte Datensätze Center Webdienst als Antwort auf diese Anforderung zurückgegebene Informationen bereitstellt. Dieser Parameter wird nicht initialisiert übergeben. Weitere Informationen finden Sie unter Records Center Web Service Methods.

Rückgabewert

Typ: Microsoft.SharePoint.OfficialFileResult
Ein OfficialFileResult -Wert.

Hinweise

Diese Methode sendet eine Datei für die Archivierung in einem Datenarchiv. Weitere Informationen finden Sie unter Records Center Overview.

Wenn Datensätze Center Web Service für die aktuelle Webanwendung konfiguriert ist, können Benutzer mit der rechten Maustaste in ein Dokument in einer Bibliothek und wählen Sie aus dem Menü Bearbeiten Control Block an das Datenarchiv senden . Die SendToOfficialFile -Methode können Sie den gleichen Vorgang aus, z. B. in einem Ereignishandler oder als Teil eines Workflows automatisieren.

Wenn der Webdienst OfficialFileResult.MoreInformationzurückgibt, wird detaillierte Informationen an der Variablen in das Argument für den Parameter additionalInformation ausgegeben.

Beispiele

In diesem Beispiel wird veranschaulicht, wie Sie eine Datei im Repository offizielle Datensätze zu senden.

public void ArchiveFile(SPFile file)
{
    String recordSeries = file.Item.ContentType.Name;
    String additionalInformation = null;
    OfficialFileResult returnValue;

    // WSS needs the file to be checked in to know which version to send.
    if (file.Level == SPFileLevel.Checkout)
    {
        file.CheckIn(String.Empty, SPCheckinType.MinorCheckIn);
    } 
    
    returnValue = file.SendToOfficialFile(recordSeries, out additionalInformation);

    // Custom code for handling the response from the service.
    switch (returnValue)
    {
        case OfficialFileResult.MoreInformation:
            // Notify user.
            break;
        case OfficialFileResult.Success:
            //Notify user.
            break;
        default:
            // Handle error.
            break;
    }
}
Public Sub ArchiveFile(ByRef file As SPFile)

    Dim recordSeries As String = file.Item.ContentType.Name
    Dim additionalInformation As String = null
    Dim returnValue As OfficialFileResult

    ' WSS needs the file to be checked in to know which version to send.
    If file.Level = SPFileLevel.Checkout Then
        file.CheckIn(String.Empty, SPCheckinType.MinorCheckIn)
    End If

    returnValue = file.SendToOfficialFile(recordSeries, additionalInformation)

    ' Custom code for handling the response from the service.
    Select Case returnValue
        Case OfficialFileResult.MoreInformation
            ' notify user
        Case OfficialFileResult.Success
            'notify user
        Case Else
            ' handle error
    End Select
End Sub

Siehe auch

Referenz

SPFile Klasse

SPFile-Member

SendToOfficialFile-Überladung

Microsoft.SharePoint-Namespace

OfficialFileResult

Weitere Ressourcen

Records Center Overview

Records Center Web Service Methods