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

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?

rayluvsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rayluvsAuthor Commented:
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
0
David LeeCommented:
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?
0
rayluvsAuthor Commented:
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.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

David LeeCommented:
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"
            olkMsg.Save
        End If
    Next
    Set olkMsg = Nothing
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rayluvsAuthor Commented:
Strange, we're are not getting an email from EE when an answer has been registered here.

Anyways, we'll check your recommendation.
0
rayluvsAuthor Commented:
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
OutlookInBoxAreaForMacro-before.jpg
OutlookInBoxAreaForMacro-After-F.jpg
OutlookMacroFillError.jpg
0
rayluvsAuthor Commented:
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:

http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_21988806.html?sfQueryTermInfo=1+10+30+chang+column+defin+outlook+user+valu
(ID: 17528213)

    and

http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_24511854.html?sfQueryTermInfo=1+%22column%22+%22outlook%22+%22popul%22+%22user+defin%22+10+30
(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
0
David LeeCommented:
Try changing this line

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

to

    Dim olkMsg As Outlook.MailItem, olkProp As Object
0
rayluvsAuthor Commented:
Yes it Worked!!!

Thanx!
0
rayluvsAuthor Commented:
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
0
rayluvsAuthor Commented:
Thanx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.