Categories in 2007 Tasks form

G

Guest

I am not sure if this is possible but here goes. We have a Tasks form which
was shared by the Staff Attorney's office and the clerks of the court, which
allowed for tracking of cases by attorney as well as status, etc.. The Court
is now using either OL XP or OL 03 .. depending on the user. In the tasks
form there is a field called CATEGORY in which the users can type in a code
... such as ORD, OP, DEC ORD, etc.. Now that we are testing OL 07, and when
these shared tasks are viewed, the CATEGORY field is no longer able to be
typed in. It apparently is synching up with the categorization function of
the Calendar. I believe Sue Mosher explains this as a "multi-valued" keyword
field. Short of creating a new column, and manually copying over all the
existing codes, is there some way to make the CATEGORY field editable again?

I hope I explained this OK, and thanks in advance..
 
S

Sue Mosher [MVP-Outlook]

Typed in where? In a form, you don't need to type it in, because the user can click the Categories button on the toolbar.

If you want them to type it in, that will need to be done on a separate custom page or, in Outlook 2007, a form region.
 
G

Guest

Thanks for the prompt response, however I wanted clarification on what you
meant by "it will need to be done on a separate custom page or, in Outlook
2007, a form region. What is a separate form region??? This is just a Task
list in Outlook 2007, but instead of just showing Subject & Due Date, this
one has additional fields. One of the fields is labeled CATEGORIES but has
nothing to do with the built in Categories that OL uses to differentiate
meetings in your calendar. My guess is that the field will need to be
recreated with a different name .. maybe something like DECISION TYPE. If I
do that, is there a quick and easy way to copy all of the data from one
column to the newly added DECISION TYPE column or will that just have to be
manually entered again??

Thanks again,
 
S

Sue Mosher [MVP-Outlook]

By "task list," do you mean a folder view not the custom form itself?

Form regions are a new developer feature in Outlook 2007 that allow you to create panes that can display in the Inspector window without the need for a custom form. There is extensive information on these in Help. I've also posted some links at http://outlookcode.com/article.aspx?id=59

In either a form region or a legacy custom form page, you can drag the Categories property from the Field Chooser to the page, creating a text box where the user can type in a list of categories.

If you want to copy data from one property to another for all items in a folder, you can do that with a VBA macro. See http://www.outlookcode.com/d/code/convertfields.htm

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
G

Guest

thanks a lot Sue. I guess it would be a folder view. When I click on view
Current View it shows SIMPLE LIST. I now have a question about the VBA
macro. I am obviuosly no programmer so excuse my ignorance but say I want to
copy the CATEGORIES column to a new COA DECISION TYPE column, is this what
the code would look like?

Sub ConvertFields()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItems As Items
Dim objItem As Object

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If Not objFolder Is Nothing Then
Set objItems = objFolder.Items
For Each objItem In objItems
' make sure you have a Category item
If objItem.Class = olCategory Then
' convert to your published custom form
objItem.MessageClass = "IPM.Category.Custom"
' copy data to your custom fields
objItem.UserProperties("Coa decision type") = objItem.coa decision
type
objItem.User1 = ""
objItem.Save
End If
Next
End If

Set objItems = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub

If that is correct, how is the macro processed? Would i go into
tools>design this form or would I choose tools>MACRO>Visual Basic Editor?

Thanks a lot,
 
S

Sue Mosher [MVP-Outlook]

It looks like you don't quite understand all that the code sample does, so we'd better walk through the heart of it. I hate to see anybody run code they don't understand.
' make sure you have a Category item
If objItem.Class = olCategory Then

There is no such thing as a Category item and no Class constant of olCategory. The purpose of the If ... Then statement is to ensure that only items of a particular type -- task in your case -- are modified. You'll need to fix that and use the correct value, olTask.
' convert to your published custom form
objItem.MessageClass = "IPM.Category.Custom"

You don't need this statement, which you should remove, because you are not trying to make the items use a different custom form. Also, IPM.Category.Custom would not be a valid task form name. IPM.Task.MyCategoriesForm would be.
objItem.UserProperties("Coa decision type") = objItem.coa decision type

The expression on the left is valid, but the expression on the right is not. The article at http://www.outlookcode.com/article.aspx?ID=38 explains the syntax for built-in properties, and you also have an example in the code sample:
objItem.User1 = ""

(You don't need that statement and can take it out.) For the Categories property, the correct expression would be simply objItem.Categories.
If that is correct, how is the macro processed? Would i go into
tools>design this form or would I choose tools>MACRO>Visual Basic Editor?

A macro, by definition, runs in the VBA editor -- Alt + F11. If you're new to Outlook VBA, you might find the information at http://outlookcode.com/article.aspx?id=49 useful.
Set objApp = CreateObject("Outlook.Application")

Also, because this is a really old sample, this statement should be replaced with:

Set objApp = Application
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
G

Guest

Thanks Sue ..

I will step back and take a closer look at the other links you provided. In
the meantime, I really appreciate your assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top