![]() |
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
|
|||
|
|||
![]()
We've created a custom contact form, it basically adds a new tab and
some new fields we use for sorting....the custom contacts reside in a public folder. (we're using Outlook 2000/2003, Exchange 2003). Secretaries will use a card scanner to scan in new contacts which then reside in a local folder. We want to then place those scanned in contacts into the Public folder but convert them to use our custom form. I wrote a macro that does exactly that and it works fine. BUT it doesn't change the icon, it still shows as the regular Contact icon instead of the Post icon. So what? Well quite often our sales guys will just drag some of their contacts into the Public folder. By sorting on the icon we can quickly determine which contacts are not using the custom form. So how (using vbscript) can I programmatically change the icon? J. |
#2
|
|||
|
|||
![]()
You can't change the icon directly. The icon comes from the MessageClass property of the item, which tells the item which form to use. Have you checked the value of MessageClass on some actual items?
-- 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 wrote in message oups.com... We've created a custom contact form, it basically adds a new tab and some new fields we use for sorting....the custom contacts reside in a public folder. (we're using Outlook 2000/2003, Exchange 2003). Secretaries will use a card scanner to scan in new contacts which then reside in a local folder. We want to then place those scanned in contacts into the Public folder but convert them to use our custom form. I wrote a macro that does exactly that and it works fine. BUT it doesn't change the icon, it still shows as the regular Contact icon instead of the Post icon. So what? Well quite often our sales guys will just drag some of their contacts into the Public folder. By sorting on the icon we can quickly determine which contacts are not using the custom form. So how (using vbscript) can I programmatically change the icon? J. |
#3
|
|||
|
|||
![]()
Hi Sue,
Yes I added the MessageClass 'header' from the Field Chooser and it verifies it's using the new form properly. I actually came across a posting of mine (and your response) from a few years ago. It turns out I need to use CDO and the &H10800003, listed as PR_ICON_INDEX, properties. I need to make it -1. Great, I've scoured through a bunch of code samples but can't make sense of things. Here's my code: Sub CardScanConverter() ' CardScan Converter by James Lee ' v1.1 Nov 8, 04 Dim ContactItem Dim objApp Dim objNS Dim objSrcFolder Dim objFolder Dim objSrcItem Dim FormItem Dim dlgResult Dim intCounter Set objApp = CreateObject("Outlook.Application") Set objNS = Application.GetNamespace("MAPI") Set objFolder = objNS.GetDefaultFolder(olFolderContacts) On Error Resume Next Set objSrcFolder = objFolder.Folders("CardScan") If Err.Number = "-2147221233" Then MsgBox "CardScan folder is missing or has been moved", vbCritical Exit Sub End If Set objSrcItem = objSrcFolder.Items If objSrcItem.Count 0 Then For Each Item In objSrcItem Item.MessageClass = "IPM.Contact.Contact Form" ' I need something like Item.Fields(&H10800003) = -1 Item.Save Next Item MsgBox "Contact(s) successfully converted", vbInformation Else MsgBox "CardScan folder is empty", vbExclamation End If Set ContactItem = Nothing Set objApp = Nothing Set objNS = Nothing Set objSrcFolder = Nothing Set objFolder = Nothing Set objSrcItem = Nothing Set FormItem = Nothing Set dlgResult = Nothing Set intCounter = Nothing End Sub Sue Mosher [MVP-Outlook] wrote: You can't change the icon directly. The icon comes from the MessageClass property of the item, which tells the item which form to use. Have you checked the value of MessageClass on some actual items? -- 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 wrote in message oups.com... We've created a custom contact form, it basically adds a new tab and some new fields we use for sorting....the custom contacts reside in a public folder. (we're using Outlook 2000/2003, Exchange 2003). Secretaries will use a card scanner to scan in new contacts which then reside in a local folder. We want to then place those scanned in contacts into the Public folder but convert them to use our custom form. I wrote a macro that does exactly that and it works fine. BUT it doesn't change the icon, it still shows as the regular Contact icon instead of the Post icon. So what? Well quite often our sales guys will just drag some of their contacts into the Public folder. By sorting on the icon we can quickly determine which contacts are not using the custom form. So how (using vbscript) can I programmatically change the icon? J. |
#4
|
|||
|
|||
![]()
You have to use CDO 1.21 or Outlook Redemption to work with MAPI properties. See http://www.cdolive.com/cdo10.htm for a primer on MAPI properties. The sample at http://www.outlookcode.com/codedetail.aspx?id=716 shows REdemption in action.
-- 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 wrote in message oups.com... Hi Sue, Yes I added the MessageClass 'header' from the Field Chooser and it verifies it's using the new form properly. I actually came across a posting of mine (and your response) from a few years ago. It turns out I need to use CDO and the &H10800003, listed as PR_ICON_INDEX, properties. I need to make it -1. Great, I've scoured through a bunch of code samples but can't make sense of things. Here's my code: Sub CardScanConverter() ' CardScan Converter by James Lee ' v1.1 Nov 8, 04 Dim ContactItem Dim objApp Dim objNS Dim objSrcFolder Dim objFolder Dim objSrcItem Dim FormItem Dim dlgResult Dim intCounter Set objApp = CreateObject("Outlook.Application") Set objNS = Application.GetNamespace("MAPI") Set objFolder = objNS.GetDefaultFolder(olFolderContacts) On Error Resume Next Set objSrcFolder = objFolder.Folders("CardScan") If Err.Number = "-2147221233" Then MsgBox "CardScan folder is missing or has been moved", vbCritical Exit Sub End If Set objSrcItem = objSrcFolder.Items If objSrcItem.Count 0 Then For Each Item In objSrcItem Item.MessageClass = "IPM.Contact.Contact Form" ' I need something like Item.Fields(&H10800003) = -1 Item.Save Next Item MsgBox "Contact(s) successfully converted", vbInformation Else MsgBox "CardScan folder is empty", vbExclamation End If Set ContactItem = Nothing Set objApp = Nothing Set objNS = Nothing Set objSrcFolder = Nothing Set objFolder = Nothing Set objSrcItem = Nothing Set FormItem = Nothing Set dlgResult = Nothing Set intCounter = Nothing End Sub Sue Mosher [MVP-Outlook] wrote: You can't change the icon directly. The icon comes from the MessageClass property of the item, which tells the item which form to use. Have you checked the value of MessageClass on some actual items? wrote in message oups.com... We've created a custom contact form, it basically adds a new tab and some new fields we use for sorting....the custom contacts reside in a public folder. (we're using Outlook 2000/2003, Exchange 2003). Secretaries will use a card scanner to scan in new contacts which then reside in a local folder. We want to then place those scanned in contacts into the Public folder but convert them to use our custom form. I wrote a macro that does exactly that and it works fine. BUT it doesn't change the icon, it still shows as the regular Contact icon instead of the Post icon. So what? Well quite often our sales guys will just drag some of their contacts into the Public folder. By sorting on the icon we can quickly determine which contacts are not using the custom form. So how (using vbscript) can I programmatically change the icon? J. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how do i change the icon for a folder | tigrib | Outlook - Using Contacts | 1 | September 29th 06 02:53 PM |
Outlook 2003, change class of message | [email protected] | Outlook - Using Forms | 1 | March 29th 06 09:21 PM |
outlook 2000 changing msg class using utility? bewildered | CYBER23HYPER | Outlook - Using Forms | 12 | March 7th 06 02:39 PM |
changing the message icon? | Sydney | Outlook and VBA | 1 | January 25th 06 05:14 PM |
outlook 2000 changing msg class using utility? | CYBER23HYPER | Outlook - General Queries | 1 | January 25th 06 03:27 PM |