SyncObjects 属性 (Outlook)NameSpace.SyncObjects property (Outlook)

返回一个**SyncObjects** 集合, 其中包含所有发送 \ 接收组。Returns a SyncObjects collection containing all Send\Receive groups. 此为只读属性。Read-only.

语法Syntax

expressionexpression. SyncObjects

_表达式_一个代表NameSpace对象的变量。expression A variable that represents a NameSpace object.

示例Example

本 Microsoft Visual Basic for Applications (VBA) 示例显示为用户设置的所有发送和接收组, 并根据用户的响应启动同步。This Microsoft Visual Basic for Applications (VBA) example displays all the Send and Receive groups set up for the user and starts the synchronization based on the user's response.

Public Sub Sync() 
 
 Dim nsp As Outlook.NameSpace 
 
 Dim sycs As Outlook.SyncObjects 
 
 Dim syc As Outlook.SyncObject 
 
 Dim i As Integer 
 
 Dim strPrompt As Integer 
 
 Set nsp = Application.GetNamespace("MAPI") 
 
 Set sycs = nsp.SyncObjects 
 
 For i = 1 To sycs.Count 
 
 Set syc = sycs.Item(i) 
 
 strPrompt = MsgBox("Do you wish to synchronize " & syc.Name &"?", vbYesNo) 
 
 If strPrompt = vbYes Then 
 
 syc.Start 
 
 End If 
 
 Next 
 
End Sub

另请参阅See also

命名空间对象NameSpace Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.