error 461 method not found on a Outlook folder object

Andy74

Registered User.
Local time
Today, 14:12
Joined
May 17, 2014
Messages
126
Hello Everybody,

I have a strange behaviour on a module which reference to Microsoft Outlook Object Library 14.0. The below code got an error 461 on the folderoutlook.display code,i.e. the method is not found. The funny thing is that the same code gives no problem in another accdb file, exactly same code with same reference on same machine. Any hint is highly appreciated!

Andy74


Set appOutlook = GetObject(, "Outlook.Application")
Set appOutlook = New Outlook.Application
Set namespaceOutlook = appOutlook.GetNamespace("MAPI")
Dim folderOutlook As Folder
Set folderOutlook = namespaceOutlook.GetDefaultFolder(olFolderInbox)
FolderOutlook.Display
 
Did you set the references to the "Microsoft Outlook Object"?
To add a reference to a library:
  1. Open the database.
  2. Press ALT+F11 to start Visual Basic Editor.
  3. On the Tools menu, click References.
  4. Under Available References, click to select the check box next to the name of the library, and then click OK.
 
I doubt very much that this is "exactly same code" as working code. Because Access also has a type called Folder, which is not the same as Outlook.Folder, that your declaration should have been.
 
JHB: yes, I pointed the correct references!
 
SPIKEPL: thanks very much, well actually I changed the code with the outlook.folder datatype and it works!
Anyway believe me that exactly the code with the folder datatype was correctly compiled in another application.
Thanks very much
andy74
 

Users who are viewing this thread

Back
Top Bottom