0
我們如何自動/以編程方式在outlook 2007中設置發件人/聯繫人圖片?他們是同事,所有員工的照片都存儲在netshare中。如何以編程方式在Outlook 2007中設置聯繫人圖像?
我們如何自動/以編程方式在outlook 2007中設置發件人/聯繫人圖片?他們是同事,所有員工的照片都存儲在netshare中。如何以編程方式在Outlook 2007中設置聯繫人圖像?
我看到Outlook.ContactItem有一個AddPicture方法。以下是幫助文件中的一個示例:
Sub AddPictureToAContact()
Dim myNms As Outlook.NameSpace
Dim myFolder As Outlook.Folder
Dim myContactItem As Outlook.ContactItem
Dim strName As String
Dim strPath As String
Dim strPrompt As String
Set myNms = Application.GetNamespace("MAPI")
Set myFolder = myNms.GetDefaultFolder(olFolderContacts)
strName = InputBox("Type the name of the contact: ")
Set myContactItem = myFolder.Items(strName)
If myContactItem.HasPicture = True Then
strPrompt = MsgBox("The contact already has a picture associated with it. Do you want to overwrite the existing picture?", vbYesNo)
If strPrompt = vbNo Then
Exit Sub
End If
End If
strPath = InputBox("Type the file name for the contact: ")
myContactItem.AddPicture (strPath)
myContactItem.Save
myContactItem.Display
End Sub