Hi

I am busy making an app that searches through all items in my inbox and saves certain types of attachments to a specified folder.

However when i run my program i get the an error
"Automation error, The specified module could not be found"

Under the references i have "Microsoft Outlook 11.0 Object library" ticked as well as a couple others.

the error occurs when the following line is executed

VB Code:
  1. Set oOutlook = New Outlook.Application

the part of code is below

VB Code:
  1. Dim oOutlook As Outlook.Application
  2. Dim oNs As Outlook.NameSpace
  3. Dim oFldr As Outlook.MAPIFolder
  4. Dim oMessage As Object
  5. Dim sPathName As String
  6. Dim oAttachment As Outlook.Attachment
  7. Dim iCtr As Integer
  8. Dim iAttachCnt As Integer
  9.  
  10. If txtPath = "" Then
  11.  MsgBox "Enter a path to save attachments to!", vbExclamation + vbOKOnly, "Path problem"
  12. Else
  13.  sPathName = txtPath.Text
  14.  If Right(sPathName, 1) <> "\" Then sPathName = sPathName & "\"
  15.    If Dir(sPathName, vbDirectory) = "" Then FileSystem.MkDir (sPathName)
  16.  
  17.    [COLOR=Red] Set oOutlook = New Outlook.Application[/COLOR]
  18.     Set oNs = oOutlook.GetNamespace("MAPI")
  19.     Set oFldr = oNs.GetDefaultFolder(olFolderInbox)

Any help would be greatly appreciated.

Thanks
Nath