Aracılığıyla paylaş


DocumentBase.New Olay

Yeni bir belge oluşturulduğunda gerçekleşir.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll içinde)

Sözdizimi

'Bildirim
Public Event New As DocumentEvents2_NewEventHandler
public event DocumentEvents2_NewEventHandler New

Notlar

Bu olay yalnızca bir şablondan yeni bir belge oluşturulduğunda oluşturulur.

Örnekler

Aşağıdaki kod örneği, yeni bir belge oluşturulduğunda, bir ileti görüntülemek için bir olay işleyicisi oluşturur.Bu örneği kullanmak için çalıştırın ThisDocument sınıfında bir Word şablonu projesi.

Private Sub DocumentNew()
    AddHandler Me.New, AddressOf ThisDocument_New
End Sub

Private Sub ThisDocument_New()
    MessageBox.Show("The Document.New event has fired.")
End Sub
private void DocumentNew()
{
    this.New += new Microsoft.Office.Interop.Word.
        DocumentEvents2_NewEventHandler(
        ThisDocument_New);
}

void ThisDocument_New()
{
    MessageBox.Show("The Document.New event has fired.");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

DocumentBase Sınıf

Microsoft.Office.Tools.Word Ad Alanı