Strange behaviour

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've just migrated to 2007 and code that used to work is giving errors. The
code is generic,
Dim myItem As Outlook.MailItem
Dim myRecipient As Outlook.Recipient

Set myItem = Application.CreateItem(olMailItem)

but the software is now telling me can't find CreateItem. The exact error
is "Method or data memer not found". I assume its due to the overzealous
security in 2007, but come someone help me fix this??

H
 
I've just migrated to 2007 and code that used to work is giving errors. The
code is generic,
Dim myItem As Outlook.MailItem
Dim myRecipient As Outlook.Recipient

Set myItem = Application.CreateItem(olMailItem)

but the software is now telling me can't find CreateItem. The exact error
is "Method or data memer not found". I assume its due to the overzealous
security in 2007, but come someone help me fix this??

H

Have you confirmed that your references are set correctly?
Outlook is not usually selected as a reference by default.

In the coding area select from the menu bar Tools|References...
and verify that you have selected 'Microsoft Outlook 11.0 Object
Library'

I am using Access 2003 so I am not sure the reference will be exactly
the same.

Hope this helps.

MAC
 
Thanks MAC. That's exactly the issue. The references are set correctly, and
it worked in 2003, but 2007 falls over. What am i missing?
 
Back
Top