Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / November 2006

Tip: Looking for answers? Try searching our database.

Exchange 2003 wrecks my code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lee.james@spartan.ab.ca - 09 Nov 2006 17:48 GMT
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
Sue Mosher [MVP-Outlook] - 30 Nov 2006 16:34 GMT
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?

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

>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
[quoted text clipped - 44 lines]
>            End If
>        Next Item
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.