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:
Set oOutlook = New Outlook.Application
the part of code is below
VB Code:
Dim oOutlook As Outlook.Application Dim oNs As Outlook.NameSpace Dim oFldr As Outlook.MAPIFolder Dim oMessage As Object Dim sPathName As String Dim oAttachment As Outlook.Attachment Dim iCtr As Integer Dim iAttachCnt As Integer If txtPath = "" Then MsgBox "Enter a path to save attachments to!", vbExclamation + vbOKOnly, "Path problem" Else sPathName = txtPath.Text If Right(sPathName, 1) <> "\" Then sPathName = sPathName & "\" If Dir(sPathName, vbDirectory) = "" Then FileSystem.MkDir (sPathName) [COLOR=Red] Set oOutlook = New Outlook.Application[/COLOR] Set oNs = oOutlook.GetNamespace("MAPI") Set oFldr = oNs.GetDefaultFolder(olFolderInbox)
Any help would be greatly appreciated.
Thanks
Nath




Reply With Quote