Strange behaviour

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
 
M

MAC

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
 
G

Guest

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?
 

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