アクティブ ドキュメントのローカル コピーとサーバー コピーの同期の状態を取得します。 読み取り専用です。
注:
Microsoft Office 2010 以降、このオブジェクトまたはメンバーは推奨されていないため、使用しないでください。
構文
式。状態
expression 必須です。 Sync オブジェクトを表す変数です。
注釈
作業中の文書のローカル コピーが共有サーバーのコピーを同期するかどうかを判断するのにには、 Status プロパティを使用します。 状態を更新するのにには、 GetUpdate メソッドを使用します。
必要に応じて、次のメソッドとプロパティを使用し、さまざまな 状態条件に対応します。
msoSyncStatusConflict. ローカル コピーとサーバー コピーの両方に変更がある場合は true。 Use the ResolveConflict method to resolve the differences.
msoSyncStatusError. ErrorType プロパティをチェックします。
msoSyncStatusLocalChanges. ローカル コピーのみに変更がある場合は true。 Use the PutUpdate method to save local changes to the server copy.
msoSyncStatusNewerAvailable. サーバー コピーのみに変更がある場合は true。 Close and re-open the document to work with the latest copy from the server.
msoSyncStatusSuspended. Unsuspend メソッドを使用して、同期を再開します。
Status プロパティは、次の優先順位の一覧から 1 つの定数を返します。
msoSyncStatusNoSharedWorkspace
msoSyncStatusError
msoSyncStatusSuspended
msoSyncStatusConflict
msoSyncStatusNewerAvailable
msoSyncStatusLocalChanges
msoSyncStatusLatest
例
次の例は、 Status プロパティをチェックし、に応じて、ドキュメントのローカル コピーとサーバー コピーを同期する適切なアクションを実行します。
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
関連項目
サポートとフィードバック
Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。