View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default Help with Outlook & a movie list

Andrew


I've received details on creating emails from Excel using macros. Can
anyone tell me how to assign a Category from the Options Tab to an Outlook
email message created with an Excel macro?


Use the Categories property.

Sub test()

Dim olapp As Outlook.Application
Dim olmail As Outlook.MailItem

Set olapp = New Outlook.Application
Set olmail = olapp.CreateItem(olMailItem)

With olmail
.To = "
.Subject = "Test Category"
.Body = "This is a category test"
.Categories = "Phone Calls"
.Send
End With

Set olmail = Nothing
Set olapp = Nothing

End Sub

See more on sending emails here

http://www.dicks-clicks.com/excel/olSending.htm

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.