DocumentBase.SyncEvent Olay
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belge çalışma alanının parçası olan bir belgenin yerel kopyası sunucudaki kopyayla eşitlendiğinde gerçekleşir.
public event Microsoft.Office.Interop.Word.DocumentEvents2_SyncEventHandler SyncEvent;
Olay Türü
Örnekler
Aşağıdaki kod örneği, belgenin bir belge çalışma alanının parçası olup olmadığını belirler. Eğer ise, kod SyncEvent eşitleme başarısız olduğunda iletiyi görüntüleyen olaya bir olay işleyicisi ekler. Bu örneği kullanmak için, ThisDocument belge düzeyindeki bir projedeki sınıfından çalıştırın.
private void DocumentSyncAndSyncEvent()
{
if (this.Sync.Status ==
Office.MsoSyncStatusType.msoSyncStatusNoSharedWorkspace)
{
MessageBox.Show("The document is not part of a " +
"shared document workspace.");
return;
}
this.SyncEvent +=
new Word.DocumentEvents2_SyncEventHandler(
ThisDocument_SyncEvent);
}
void ThisDocument_SyncEvent(Office.MsoSyncEventType SyncEventType)
{
if (SyncEventType ==
Office.MsoSyncEventType.msoSyncEventDownloadFailed ||
SyncEventType ==
Office.MsoSyncEventType.msoSyncEventUploadFailed)
{
MessageBox.Show("Document synchronization failed. " +
"Please contact your administrator.");
}
}
Private Sub DocumentSyncAndSyncEvent()
If Me.Sync.Status = Office.MsoSyncStatusType.msoSyncStatusNoSharedWorkspace Then
MessageBox.Show("The document is not part of a " & "shared document workspace.")
Return
End If
AddHandler Me.SyncEvent, AddressOf ThisDocument_SyncEvent
End Sub
Private Sub ThisDocument_SyncEvent(ByVal SyncEventType As Office.MsoSyncEventType)
If SyncEventType = Office.MsoSyncEventType.msoSyncEventDownloadFailed _
OrElse SyncEventType = Office.MsoSyncEventType.msoSyncEventUploadFailed Then
MessageBox.Show("Document synchronization failed. " & _
"Please contact your administrator.")
End If
End Sub