共用方式為


DAVAdapter.Submit 方法

在關聯的中繼層上執行送出作業。

**命名空間:**Microsoft.Office.Interop.InfoPath
**組件:**Microsoft.Office.Interop.InfoPath (於 microsoft.office.interop.infopath.dll 中)

語法

'宣告
<DispIdAttribute(11)> _
Sub Submit
'用途
Dim instance As DAVAdapter

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

範例

在下列範例中,DAVAdapterObject 物件的 Submit 方法是用於將 XML 文件送出至 Windows SharePoint Server 文件庫。此程式碼需要名為 "Submit" 的 SharePoint 表單庫 [資料連接]。

// 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 + ".");
}

請參閱

參考

DAVAdapter 介面
DAVAdapter 成員
Microsoft.Office.Interop.InfoPath 命名空間