Outlook VBA教程:AddressBookName属性

返回或设置当前MAPIFolder对象的通讯簿名称。String 类型,可读写。

expression.AddressBookName

expression  必选。该表达式返回 MAPIFolder对象。

VBA示例

以下示例更改指定文件夹的通讯簿名称,并向用户显示新名称。子例程接受一个文件夹对象和一个代表新文件夹名称的 String 类型值。


Sub BookName()
    Dim olApp As Outlook.Application
    Dim nmsName As NameSpace
    Dim fldFolder As MAPIFolder
    Dim strAns As String
    Set olApp = Outlook.Application
    'Create a reference to namepsace
    Set nmsName = olApp.GetNamespace("MAPI")
    'Create an instance of the Inbox folder
    Set fldFolder = nmsName.GetDefaultFolder(olFolderInbox)
    'Prompt user for input
    strAns = InputBox("Enter the name of the new address book")
    'Call Sub procedure
    Call Changebook(fldFolder, strAns)
End Sub
Sub Changebook(ByRef fldFolder As MAPIFolder, ByVal strName As String)
'Changes the name of the address book for a given folder
    'Set address book name to user input
    fldFolder.AddressBookName = strName
    'Display message to user
    MsgBox ("The new address book name for the " & fldFolder.Name & " folder is " _
             & strName & ".")
End Sub

上页:Outlook VBA教程:Address属性 下页:Outlook VBA教程:AddressEntries属性

Outlook VBA教程:AddressBookName属性:相关链接

Outlook VBA教程:AddressEntries属性 Outlook VBA教程:AddressEntry属性
Outlook VBA教程:AddressLists属性 Outlook VBA教程:AllDayEvent属性
Outlook VBA教程:AlternateRecipientAllowed属性 Outlook VBA教程:Anniversary属性
Outlook VBA教程:AnswerWizard属性 Outlook VBA教程:AppFolders属性
Outlook VBA教程:Application属性 Outlook VBA教程:AppointmentItem属性
Outlook VBA教程:Assistant属性 Outlook VBA教程:AssistantName属性
Outlook VBA教程:AssistantTelephoneNumber属性 Outlook VBA教程:Attachments属性
Outlook VBA教程:AutoForwarded属性 Outlook VBA教程:AutoResponse属性
Outlook VBA教程:BCC属性 Outlook VBA教程:BillingInformation属性
Outlook VBA教程:Birthday属性 Outlook VBA教程:Body属性
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号