命名空间 Offline 属性 (Outlook)NameSpace.Offline property (Outlook)

返回一个Boolean类型的值, 如果 Outlook 处于脱机状态 (未连接到 exchange 服务器), 则返回True ; 如果联机 (连接到 exchange 服务器), 则返回FalseReturns a Boolean indicating True if Outlook is offline (not connected to an Exchange server), and False if online (connected to an Exchange server). 此为只读属性。Read-only.

语法Syntax

expressionexpression. Offline

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

说明Remarks

Offline 属性仅返回 Exchange 配置文件的有效信息。The Offline property returns valid information only for an Exchange profile. 它并不适用于非 Exchange 帐户类型, 如 POP3、IMAPI 和 HTTP。It is not intended for non-Exchange account types such as POP3, IMAPI, and HTTP.

如果**ExchangeConnectionMode** 属性为olOfflineolDisconnected, 则脱机属性将返回TrueIf the NameSpace.ExchangeConnectionMode property is olOffline or olDisconnected, the Offline property will return True. 如果 ExchangeConnectionMode 属性为 olOnlineolConnectedolConnectedHeadersOffline 属性将返回 FalseIf the ExchangeConnectionMode property is olOnline, olConnected, or olConnectedHeaders, the Offline property will return False.

示例Example

下面的 Microsoft Visual Basic for Applications (VBA) 示例返回TrueFalse , 具体取决于NameSpace对象当前是否处于联机状态。The following Microsoft Visual Basic for Applications (VBA) example returns True or False depending on whether the NameSpace object is currently online.

Sub Off() 
 
 'Determines whether Outlook is currently offline. 
 
 Dim nmsName As Outlook.NameSpace 
 
 
 
 Set nmsName = Application.GetNamespace("MAPI") 
 
 MsgBox nmsName.Offline 
 
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.