![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
Is there a way to apply a photo to a contact via VBA or DotNet? Thank you. |
Ads |
#2
|
|||
|
|||
![]()
No.
FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Programatix" wrote in message ... Hi, Is there a way to apply a photo to a contact via VBA or DotNet? Thank you. |
#3
|
|||
|
|||
![]()
Drat! I completely forgot about the ContactItem.AddPicture method, which
should do just what you want. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Programatix" wrote in message ... Hi, Is there a way to apply a photo to a contact via VBA or DotNet? Thank you. |
#4
|
|||
|
|||
![]()
Thanks. Well, I figured that out and came up with the following code below.
The image file must be named as the contact's save as name. Public Sub UpdateContactPhoto(ContactPhotoPath As String) Dim myOlApp As Outlook.Application Dim myNamespace As Outlook.NameSpace Dim myContacts As Outlook.Items Dim myItems As Outlook.Items Dim myItem As Object Set myOlApp = CreateObject("Outlook.Application") Set myNamespace = myOlApp.GetNamespace("MAPI") Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts).Ite ms Dim fs As Object Set fs = CreateObject("Scripting.FileSystemObject") For Each myItem In myContacts If (myItem.Class = olContact) Then Dim myContact As Outlook.ContactItem Set myContact = myItem Dim strPhoto As String strPhoto = ContactPhotoPath & myContact.FileAs & ".jpg" If fs.FileExists(strPhoto) Then myContact.AddPicture strPhoto myContact.Save End If End If Next End Sub "Sue Mosher [MVP-Outlook]" wrote in message ... Drat! I completely forgot about the ContactItem.AddPicture method, which should do just what you want. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Programatix" wrote in message ... Hi, Is there a way to apply a photo to a contact via VBA or DotNet? Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
envoi de photo | christine lucy | Outlook Express | 34 | November 11th 06 03:33 AM |
how do I apply a form to one Contact? | don | Outlook - Using Forms | 1 | July 5th 06 07:40 PM |
Paste a photo | JOHN SMITH | Outlook Express | 0 | June 5th 06 09:02 PM |
Paste a photo | MarkC | Outlook Express | 4 | May 15th 06 09:42 AM |
how to apply vba code to OL2003 forms ? | TimR | Outlook - Using Contacts | 1 | February 17th 06 05:41 PM |