Log in

View Full Version : Buttons and UDFs - Outlook 2010



IAMDAN
05-20-2015, 02:39 AM
Hi there.

This is my first foray into Outlook VBA and am looking for a little help to get me started.

I am using Outlook 2010.

I am wanting to do three things.

1) CSO Name:

I have a button called 'CSO Name' and I have a user defined field called 'CSO Name'.
I want my button to populate the udf on the currently selected email with the current users email address.

2) Started:

I have a button called 'Start' and I have a user defined field called 'Started'.
I want my button to populate the udf on the currently selected email with the current date and time.

3) Finished:

I have a button called 'Finish' and I have a user defined field called 'Finished'.
I want my button to populate the udf on the currently selected email with the current date and time.

Can anybody help me with code for any of the above?

Any help is very much appreciated.

Thanks,

Dan.

skatonni
05-21-2015, 12:37 PM
This describes the UserProperties.Add Method https://msdn.microsoft.com/en-us/library/office/ff867389(v=office.14).aspx

Inbox.Parent gets you the Mailbox name which should be the current user address.

currItem.UserProperties.Add("CSO Name", olText).Value = strMailboxName

currItem.UserProperties.Add("Started", olDateTime).Value = Now