Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Sync Property (2007 System)
Collapse the table of content
Expand the table of content

Document.Sync Property (2007 System)

Gets a Sync object that provides access to the methods and properties of documents that are part of a Document Workspace.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

[BrowsableAttribute(false)]
public Sync Sync { get; }

Property Value

Type: Sync
A Sync object that provides access to the methods and properties of documents that are part of a Document Workspace.

The following code example determines whether the document is part of a Document Workspace. If it is, the code attaches an event handler to the SyncEvent event that displays a message when the synchronization fails.

This example is for a document-level customization.

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

Community Additions

ADD
Show:
© 2015 Microsoft