命名空间 AddStoreEx 方法 (Outlook)NameSpace.AddStoreEx method (Outlook)

以指定格式将个人文件夹文件 (.pst) 添加到当前配置文件。Adds a Personal Folders file (.pst) in the specified format to the current profile.

语法Syntax

expressionexpression. AddStoreEx( _Store_ , _Type_ )

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

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
StoreStore 必需Required VariantVariant 要添加到配置文件中的 .pst 文件的路径。The path of the .pst file to be added to the profile. 如果 .pst 文件不存在,Microsoft Outlook 将创建该文件。If the .pst file does not exist, Microsoft Outlook creates it.
TypeType 必需Required OlStoreTypeOlStoreType 创建数据文件应使用的格式。The format in which the data file should be created.

说明Remarks

使用olStoreUnicode常量添加一个新的 .pst 文件, 该文件具有更大的项目和文件夹存储容量, 并支持多语言 Unicode 数据到用户的配置文件。Use the olStoreUnicode constant to add a new .pst file that has greater storage capacity for items and folders and supports multilingual Unicode data, to the user's profile. OlStoreANSI 常量可以创建.pst 文件,不提供完全支持多语言 Unicode 数据,但与 Outlook 的早期版本兼容。The olStoreANSI constant allows you to create .pst files that do not provide full support for multilingual Unicode data, but are compatible with earlier versions of Outlook. OlStoreDefault 常量可帮助您与 Microsoft Exchange Server 运行 Outlook 邮箱模式兼容的默认格式创建一个.pst 文件。The olStoreDefault constant helps you create a .pst file in the default format that is compatible with the mailbox mode in which Outlook runs on the Microsoft Exchange Server.

示例Example

本 Microsoft Visual Basic for Applications (VBA) 示例添加了新的个人文件夹 (.pst) 文件, 该文件具有更大的项目和文件夹存储容量, 并支持将 Unicode 用于用户的配置文件。This Microsoft Visual Basic for Applications (VBA) example adds a new Personal Folders (.pst) file that has greater storage capacity for items and folders and supports Unicode to the user's profile.

Sub CreateUnicodePST() 
 
 Dim myNameSpace As Outlook.NameSpace 
 
 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 
 myNameSpace.AddStoreEx "c:\" & myNameSpace.CurrentUser & "\.pst",olStoreUnicode 
 
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.