Share via


SaveEventArgs インターフェイス

定義

BeforeSave イベントのデータを提供します。

public interface class SaveEventArgs
[System.Runtime.InteropServices.Guid("06c7ed15-2df8-4a5c-acf4-10cdd5a6a510")]
public interface SaveEventArgs
[<System.Runtime.InteropServices.Guid("06c7ed15-2df8-4a5c-acf4-10cdd5a6a510")>]
type SaveEventArgs = interface
Public Interface SaveEventArgs
属性

次のコード例は、 イベントのイベント ハンドラーを BeforeSave 示しています。 ドキュメントを保存すると、イベント ハンドラーによって、保存操作を取り消すか続行するように求められます。

この例は、ドキュメント レベルのカスタマイズ用です。

private void DocumentBeforeSave()
{
    this.BeforeSave += new Microsoft.Office.Tools.Word.SaveEventHandler(ThisDocument_BeforeSave);
}

void ThisDocument_BeforeSave(object sender, Microsoft.Office.Tools.Word.SaveEventArgs e)
{
    if (MessageBox.Show("Do you want to save the document?", "BeforeSave",
        MessageBoxButtons.YesNo) == DialogResult.No)
    {
        e.Cancel = true;
    }
}
Private Sub DocumentBeforeSave()
    AddHandler Me.BeforeSave, AddressOf ThisDocument_BeforeSave
End Sub

Private Sub ThisDocument_BeforeSave(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.SaveEventArgs)
    If MessageBox.Show("Do you want to save the document?", "BeforeSave", _
        MessageBoxButtons.YesNo) = DialogResult.No Then
        e.Cancel = True
    End If
End Sub

プロパティ

Cancel

保存操作を取り消すかどうかを示す値を取得または設定します。

ShowSaveAsDialog

[名前を付けて保存] ダイアログ ボックスを表示するかどうかを示す値を取得または設定します。

適用対象