Automate in Outlook 2007 to fill the user-define column TYPE with same data info

Posted on 2011-10-04
Medium Priority
Last Modified: 2012-05-12
We are trying to create a macro or VBA where we fill a user-define column labeled TYPE with "PROYECTONE".

We have configure the specific Inbox folder so the user-define column TYPE can be edited.  That is what we do at any given time; we click the row and the column TYPE once and it becomes editable, then we type the word PROYECTONE.

What's the best to go about it?

Question by:rayluvs
  • 8
  • 3

Author Comment

ID: 36914936
FYI, to make the column editable:

    1. We first create the User-Define Field
    2. Then inserted the column on the InBox folder
    3. Went to  View | Current View | Customize Current View | Other Settings
    4. Checkmark  Allow on in-cell editing
LVL 76

Expert Comment

by:David Lee
ID: 36920584
Hi, Ramante.

Sorry, but I don't understand the question.  Are you asking for a way to click a button and have a value entered in the user-defined column?

Author Comment

ID: 36920854
Yes.  A button or just running the Macro name, be executed and have that column or where the mouse is click on the column.  

FYI, the entry ID: 36914936 is only to show how we make a column editable manually.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 76

Accepted Solution

David Lee earned 2000 total points
ID: 36923442
I'm still not clear on what you're asking for, so this is a bit of a shot in the dark.

The code below adds a user-defined property named "PROYECTONE" to each selected item and populates it with the value "Enter a value".  Once you've added the property to at least one item in the folder you can modify the view to show the property in a column.
Sub FillInColumn()
    Dim olkMsg As Outlook.MailItem, olkProp As Outlook.UserDefinedProperty
    For Each olkMsg In Application.ActiveExplorer.Selection
        Set olkProp = olkMsg.UserProperties.Item("PROYECTONE")
        If TypeName(olkProp) = "Nothing" Then
            Set olkProp = olkMsg.UserProperties.Add("PROYECTONE", olText, True)
            olkProp.Value = "Enter a value"
        End If
    Set olkMsg = Nothing
End Sub

Open in new window


Author Comment

ID: 36936397
Strange, we're are not getting an email from EE when an answer has been registered here.

Anyways, we'll check your recommendation.

Author Comment

ID: 36936480
Just FYI: we think that you have a good grasp of what we want.  

Attached is a pic of the inbox before and after with the column PROYECTONE status.

We ran the script and is giving an error (see pic attached).  We though it was becuase it was already existed the column, so we place another name just in case and same error.

Please advice

Author Comment

ID: 36938979
We've been googling, trying to get this script running but no success.

We found 2 EE question you assisted on and that looks related to ours; we reviewed it and tried to compare and learn any differences but still no success:

(ID: 17528213)


(ID: 24685326)

Also, we have commented out the following line because it keeps creating it when already created the first time:

Set olkProp = olkMsg.UserProperties.Item("PROYECTONE")

Nevertheless, please advice o our problem... Thanx
LVL 76

Assisted Solution

by:David Lee
David Lee earned 2000 total points
ID: 36954615
Try changing this line

    Dim olkMsg As Outlook.MailItem, olkProp As Outlook.UserDefinedProperty


    Dim olkMsg As Outlook.MailItem, olkProp As Object

Author Comment

ID: 37034479
Yes it Worked!!!


Author Comment

ID: 37034531
Please see the the question related to this project (I place another question because this one has been completely answered).  Goto: http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_27417331.html

Author Closing Comment

ID: 37034552

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
I came across an unsolved Outlook issue and here is my solution.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses
Course of the Month16 days, 16 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question