Status property as it applies to the SharedWorkspaceTask object.
Returns or sets the status of the specified shared workspace task. Read/write msoSharedWorkspaceTaskStatus.
MsoSharedWorkspaceTaskStatus can be one of these msoSharedWorkspaceTaskStatus constants. |
msoSharedWorkspaceTaskStatusComplete (3) |
msoSharedWorkspaceTaskStatusDeferred (2) |
msoSharedWorkspaceTaskStatusInProgress (1) |
msoSharedWorkspaceTaskStatusNotStarted (4) |
msoSharedWorkspaceTaskStatusWaiting (5) |
expression.Status
expression Required. An expression that returns a SharedWorkspaceTask object.
The shared workspace task schema on the server can be customized. Customization of the schema may affect the task status enumeration when the Add or Save method is called. Status property values are mapped as follows:
Status property as it applies to the Sync object.
Returns the status of the synchronization of the local copy of the active document with the server copy. Read-only MsoSyncStatusType.
MsoSyncStatusType can be one of the following msoSyncStatusType constants. |
msoSyncStatusConflict (4) |
msoSyncStatusError (6) |
msoSyncStatusLatest (1) |
msoSyncStatusLocalChanges (3) |
msoSyncStatusNewerAvailable (2) |
msoSyncStatusNoSharedWorkspace (0) |
msoSyncStatusSuspended (5) |
expression.Status
expression Required. An expression that returns a Sync object.
Use the Status property to determine whether the local copy of the active document is synchronized with the shared server copy. Use the GetUpdate method to refresh the status. Use the following methods and properties when appropriate to respond to various status conditions:
The Status property returns a single constant from the list in the following order of precedence:
As it applies to the SharedWorkspaceTask object.
The following example displays a list of all tasks in the current shared workspace whose status is not set to Complete.
Dim swsTask As Office.SharedWorkspaceTask
Dim strTaskStatus As String
For Each swsTask In ActiveWorkbook.SharedWorkspace.Tasks
If swsTask.Status <> msoSharedWorkspaceTaskStatusCompleted Then
strTaskStatus = strTaskStatus & swsTask.Title & vbCrLf
End If
Next
MsgBox "The following tasks have not been completed:" & vbCrLf & _
strTaskStatus, vbInformation + vbOKOnly, "Incomplete Tasks"
Set swsTask = Nothing
As it applies to the Sync object.
The following example examines the Status property and takes an appropriate action to synchronize the local and server copies of the document if necessary.
Dim objSync As Office.Sync
Dim strStatus As String
Set objSync = ActiveDocument.Sync
If objSync.Status > msoSyncStatusNoSharedWorkspace Then
Select Case objSync.Status
Case msoSyncStatusConflict
objSync.ResolveConflict msoSyncConflictMerge
ActiveDocument.Save
objSync.ResolveConflict msoSyncConflictClientWins
strStatus = "Conflict resolved by merging changes."
Case msoSyncStatusError
strStatus = "Last error type: " & objSync.ErrorType
Case msoSyncStatusLatest
strStatus = "Document copies already in sync."
Case msoSyncStatusLocalChanges
objSync.PutUpdate
strStatus = "Local changes saved to server."
Case msoSyncStatusNewerAvailable
strStatus = "Newer copy available on the server."
Case msoSyncStatusSuspended
objSync.Unsuspend
strStatus = "Synchronization resumed."
End Select
Else
strStatus = "Not a shared workspace document."
End If
MsgBox strStatus, vbInformation + vbOKOnly, "Sync Information"
Set objSync = Nothing