Why won't this code work in Outlook 2003?

  • Thread starter Thread starter michaaal
  • Start date Start date
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)
 
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 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!
 
Set objNS = Application.GetNamespace("MAPI")

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