Share via


DAVAdapter.Submit, méthode

Exécute l'opération d'envoi sur l'adaptateur associé.

Espace de noms : Microsoft.Office.Interop.InfoPath
Assembly : Microsoft.Office.Interop.InfoPath (dans microsoft.office.interop.infopath.dll)

Syntaxe

<DispIdAttribute(11)> _
Sub Submit

Dim instance As DAVAdapter

instance.Submit
[DispIdAttribute(11)] 
void Submit ()

Exemple

Dans l'exemple suivant, la méthode Submit de l'objet DAVAdapterObject est utilisée pour envoyer un document XML à une bibliothèque de documents Windows SharePoint Server. Ce code requiert une Connexion de données à une bibliothèque de formulaires SharePoint nommée « Submit ».

// Get the first data adapter; a "SharePoint Library" submit adapter
DAVAdapter davAdapter = thisXDocument.DataAdapters["Submit"] as DAVAdapter;
if (davAdapter == null)
{
 thisXDocument.UI.Alert("SharePoint submit list adapter called 'Submit' was not found.");
 return;
}
// Set the file name to be the today's date (as an .xml file)
davAdapter.FileName = DateTime.Today.ToShortDateString() + ".xml";
if (davAdapter.SubmitAllowed)
{
 try
 {
  davAdapter.Submit();
 }
 catch (Exception ex)
 {
  // The save failed
  thisXDocument.UI.Alert("Saving to " + davAdapter.FolderURL + " as " + davAdapter.FileName + " failed." + Environment.NewLine + "Reason: " + ex.Message);
 }
}
else
{
 thisXDocument.UI.Alert("Submit is not allowed on adapter " + davAdapter.Name + ".");
}

Voir aussi

Référence

DAVAdapter, interface
Membres DAVAdapter
Microsoft.Office.Interop.InfoPath, espace de noms