How To Change the Icon Displayed for an Item in OWA (307638)



The information in this article applies to:

  • Microsoft Exchange Server 2003 Standard Edition
  • Microsoft Exchange 2000 Enterprise Server

This article was previously published under Q307638

SUMMARY

This article describes how to use the ActiveX Data Objects (ADO) library to change the icon that is displayed for an item in an Exchange store.

MORE INFORMATION

To change the icon, follow these steps:
  1. In Microsoft Visual Basic, create a new Standard EXE project. Form1 is created by default.
  2. On the Project menu, click References. From the list of available references, select Microsoft ActiveX Data Objects 2.5 Library.
  3. Add a command button to the default form, and paste the following code in the Click event of the command button:
    Private Sub Command1_Click()
    
    Dim InfoNT
    Dim Conn
    Dim Rec
    Dim Rs
    Dim strQ
    Dim strURL
    Set Conn = CreateObject("ADODB.Connection")
    Conn.Provider = "ExOLEDB.DataSource"
    
    Set Rs = CreateObject("ADODB.Recordset")
    Set Rec = CreateObject("ADODB.Record")
    Set InfoNT = CreateObject("WinNTSystemInfo")
    
    'To do: Change "myTLH/Sample" to a valid virtual root and folder. 
    strURL = "http://" & InfoNT.ComputerName & "/myTLH/Sample/"
    Conn.Open strURL
    
    'To do: Change the file name to a valid file in the folder noted in strURL.
    Rec.Open strURL & "test3.txt", Conn, adModeReadWrite, _
    adCreateNonCollection Or adCreateOverwrite
    
    'To do: The .gif file noted below has to be in the /exchweb/img folder.
    'You can use any .gif file you want.
    Rec.Fields("http://schemas.microsoft.com/exchange/smallicon").Value = "/exchweb/img/music.gif"
    Rec.Fields.Update
    Rec.Close
    
    Conn.Close
    Set InfoNT = Nothing
    Set Rec = Nothing
    Set Rs = Nothing
    
    MsgBox "Finished TestProps"
    End Sub
    					
  4. In the code, search for comments that are marked "To do" and make any necessary changes.
  5. Run the project and click the command button.
  6. Using Outlook Web Access (OWA), browse to the folder. Note that the new icon is displayed for the file.
Note In Microsoft Exchange Server 2003, the smallicon property on an item can no longer be modified because Microsoft Outlook Web Access (OWA) 2003 uses this property to indicate if the item has been replied to or forwarded.

Modification Type:MajorLast Reviewed:7/12/2005
Keywords:kbhowto kbMsg KB307638