Grant Carthew

Hi all,

I have created an Outlook 2007 Add-in and needed to convert it back to Outlook 2003. After discovering that Outlook 2003 does not use Categories the same way as 2007, then working out how to set labels on calendar appointment items, I have finally got the 2003 version working, sort of.

The problem I have come across is that on the dev virtual machine the add-in works fine, but when I install it on a test machine it fails. It is failing on the new 2003 code I have added for setting the labels.

After some faultfinding I have found that the CDO.dll is not being loaded on the test virtual machine. What is very interesting is I have copied the virtual machine I am using for dev and then copied the project into that machine and it is also failing.

I have run the now Microsoft tool called 'Process Monitor' and ListDlls and the dev machine has the cdo.dll loaded under the Outlook process, where the test machine does not.

I have tried the following to get the cdo.dll loading;
1) Installing it from the Office 2003 setup program
2) Getting a copy from the working dev machine and using RegSvr32 to register it
3) Downloading a new version of cdo.dll from Microsoft, extracting it from the msi file and register.
4) Adding the cdo.dll into the add-in project and getting the msi from the project to register it.
5) Registering it in its default path C:\Program Files\Common\System\MAPI\1033.

I was looking for a tool that would list all registered dll's, but did not find a good one. Ran MSInfo32 and used that to list the dll's which gives much the same info as the ListDLLs utility.

I am starting to run out of ideas.

Can anyone help please

Regards,

Grant.




Re: Visual Studio Tools for Office CDO.DLL Registration Issue

Sue Mosher - Outlook MVP

This probably isn't what you want to hear, but CDO.dll is not supported for use in .NET projects. In other words, even if you get it to work on your dev and test machines, you can't count on it working in the field. Plus, CDO.DLL is not a redistributable component.

Also, the only separate download is for Outlook 2007, to make up for the fact that it's not in the product. I wouldn't be surprised if that download didn't work in Outlook 2003.

You might want to consider using Redemption or MAPI33 for your work with MAPI properties in Outlook 2003.





Re: Visual Studio Tools for Office CDO.DLL Registration Issue

Grant Carthew

Thanks for the reply Sue.

I will take that information on board. Before rushing out and buying Redemption or MAPI33 I decided to see how to set an appointment item label using either of these products. I am having trouble finding any examples or details on the web, or on the developer's sites.

Will these libraries allow me to set the label values on calendar appointment items The code I am using at the moment is using cdo, and I got it from your site as follows;

Sub SetAppointmentItemColorLabel(ByVal appointmentItem As Outlook.AppointmentItem, _
ByVal appointmentItemColour As Integer)
Dim cdoSession As MAPI.Session
Dim cdoMessage As MAPI.Message
Dim cdoMessageFields As MAPI.Fields
Dim cdoMessageField As MAPI.Field

'Get cdo objects.
cdoSession = CreateObject("MAPI.Session")
cdoSession.Logon("", "", False, False)
cdoMessage = cdoSession.GetMessage(appointmentItem.EntryID, appointmentItem.Parent.StoreID)
cdoMessageFields = cdoMessage.Fields
cdoMessageField = cdoMessageFields.Item(CdoAppt_Colors, CdoPropSetID1)

'Set the label.
If cdoMessageField Is Nothing Then
'Add the labels field if it does not exist.
cdoMessageField = cdoMessageFields.Add(CdoAppt_Colors, vbLong, appointmentItemColour, CdoPropSetID1)
Else
'Set the labels field to the colour index.
cdoMessageField.Value = appointmentItemColour
End If
'Save the changes.
cdoMessage.Update(True, True)

'Cleanup.
cdoMessage = Nothing
cdoMessageFields = Nothing
cdoMessageField = Nothing
cdoSession.Logoff()
cdoSession = Nothing
End Sub

Will this code map through to the cdo or mapi33 references

Regards,

Grant.