Outlook 2007 で送信者/連絡先の画像を自動的に/プログラムで設定するにはどうすればよいですか? 彼らは同僚であり、すべての従業員の写真はネットシェアに保存されています。
1 に答える
1
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
于 2009-11-04T21:14:43.347 に答える