Exchange 2003 wrecks my code?

L

lee.james

I had to revisit some code I had written awhile ago - the code takes a
regular contact, creates a new custom forms based contact, copies the
relevant data, and then saves the updated form.

This worked fine previously when we were on Exchange 5.5.

I'm using the exact same code, but now it throws up 'Object required:
objOutlook.ActiveInspector' at line 42.

I used a messagebox to determine the point where it's failing and it's
when it goes to save it.

However, despite the error message everything appears to still work
fine.

So a) why am I getting this error now that we're running Exchange 2003
and b) how can I fix it?

J.

Here's the relevant code:

Set objDestFolder = objNS.Folders("Public Folders").Folders("All Public
Folders").Folders("Sales Contacts")
Set objDestItem = objDestFolder.Items
For Each Item In objSrcItem 'a
subfolder of the Contacts folder
If Item.MessageClass = "IPM.Contact" Then
Set FormItem = objDestItem.Add("IPM.Contact.Contact
Form")
FormItem.FullName = Item.FullName
FormItem.JobTitle = Item.JobTitle
FormItem.Email1Address = Item.Email1Address
FormItem.CompanyName = Item.CompanyName
FormItem.BusinessTelephoneNumber =
Item.BusinessTelephoneNumber
FormItem.BusinessFaxNumber = Item.BusinessFaxNumber
FormItem.BusinessAddress = Item.BusinessAddress
FormItem.MobileTelephoneNumber =
Item.MobileTelephoneNumber
FormItem.WebPage = Item.WebPage
FormItem.BillingInformation = "Converted"
FormItem.Save
' This is where I get the error message when I try and
save it
FormItem.Close (1)
End If
Next Item
 
S

Sue Mosher [MVP-Outlook]

I don't see any objOutlook.ActiveInspector expression in the code you posted. Which is line 42?

This statement would definitely be problematic in Outlook form code:

For Each Item In objSrcItem

because Item is already used as an intrinsic object. Use a different variable name in your For Each block.

Is the public folder set to accept only forms of a particular message class?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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