email - Modify background color of MailItem in Outlook 2013 Inbox -
is there way modify background color in outlook inbox listing of e-mails (mailitem
instances) programmatically? i'd create add-in allow me color-code emails according rules.
i've went through mailitem properties in documentation, wasn't able find display-format related.
the mailitem class doesn't provide that. instead, need customize view in outlook.
you can use currentview property of folder or explorer class view object representing current view. obtain view object view of current explorer, use explorer.currentview instead of currentview property of current folder object returned explorer.currentfolder.
the view object allows create customizable views allow better sort, group , view data of different types. there variety of different view types provide flexibility needed create , maintain important data.
- the table view type (oltableview) allows view data in simple field-based table.
- the calendar view type (olcalendarview) allows view data in calendar format.
- the card view type (olcardview) allows view data in series of cards. each card displays information contained item , can sorted.
- the icon view type (oliconview) allows view data icons, similar windows folder or explorer.
- the timeline view type (oltimelineview) allows view data received in customizable linear time line.
views defined , customized using view object's xml property. xml property allows create , set customized xml schema defines various features of view.
private sub formathandoffmessages() dim objview tableview dim objrule autoformatrule ' check if current view table view. if application.activeexplorer.currentview.viewtype = oltableview ' obtain tableview object reference current view. set objview = application.activeexplorer.currentview ' create new rule displays message ' subject line starts "handoff" in ' blue, bold, 8 point courier new text. set objrule = objview.autoformatrules.add("handoff messages") objrule .filter = """http://schemas.microsoft.com/mapi/proptag/0x0037001f""" & _ " ci_startswith 'handoff'" .font .name = "courier new" .size = "8" .bold = true .color = olcolorblue end end ' save , apply table view. objview.save objview.apply end if end sub
Comments
Post a Comment