(500pts 4 success) Use vba to modify a user defined field for an Outlook email
Posted on 2003-11-11
125 points for good suggestions, 500 points for solution.
How can I change the following Visual Basic program so it will modify MyComment instead of Categories.
Even though outlook makes it easy to create a user defined field, I haven't figure out how to change them.
(To create them I use field chooser > User-defined fields in Inbox > New > then make 3 text fields called "MyComment", "MyPublication" and "MyCoworker. Its that simple.)
Dim myOlApp As Outlook.Application, sel As Outlook.Selection, it As Object
Dim s As String
Set myOlApp = CreateObject("Outlook.Application")
Set sel = myOlApp.ActiveExplorer.Selection
s = InputBox("This will change MyComment on every selected message. What should the comment be?")
For Each it In sel
it.Categories = s ' This is the function I want to save
Set sel = Nothing
Set myOlApp = Nothing