Why won't this code work in Outlook 2003?

M

michaaal

Why won't this code work in Outlook 2003? It seems to work in Outlook 2000?

Dim objApp As Application
Dim objNS As NameSpace
Dim objContacts As MAPIFolder

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objContacts = objNS.GetDefaultFolder(olFolderContacts)
 
S

Sue Mosher [MVP-Outlook]

Is this running in Outlook VBA? Did you check your macro security settings?
You should use the intrinsic Application object instead of CreateObject.
 
M

michaaal

Sue Mosher said:
Is this running in Outlook VBA? Did you check your macro security settings?
You should use the intrinsic Application object instead of CreateObject.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Sorry Sue, I am not familiar with the Application object. Would you mind
posting an example?
I would greatly appreciate it!
 
S

Sue Mosher [MVP-Outlook]

Set objNS = Application.GetNamespace("MAPI")

--
Sue Mosher, Outlook MVP
Author of
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