Userdefined Type Not Defeind

Sub SaveAttachments()
    Dim olApp As Outlook.Application

    Dim myNameSpace As Outlook.Namespace
    Dim myFolder As Outlook.MAPIFolder
    Dim myItem As Outlook.MailItem
    Dim myAttachment As Outlook.Attachment
    Dim I As Long

Open in new window

Hi, I am getting the error on this portion 'olApp As Outlook.Application'

Under Tools - Reference I do have 'Microsoft Office 14.0 Object Library' is enabled and I am using Office 2010 suite

Any help is appreciated!
LVL 13
Who is Participating?
Michael FowlerConnect With a Mentor Solutions ConsultantCommented:
You need to use the Microsoft Outlook 14.0 Object Library not the Microsoft Office 14.0 Object Library

Shanan212Author Commented:
Aaah! Thats it :o I knew it has something to do with library but how can I forget 'outlook'! I must be tired :/

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.