Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations danielledunham on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class outlook.application is not found

foxup

Programmer
Joined
Dec 14, 2010
Messages
339
Location
CA
oOutlook = CreateObject("Outlook.Application")
oitem=oOutlook .createitem(0)
oitem.subject="Email From VFP"

oitem.to="someone@example.com"

oitem.body="This mail was sent from vfp using Outlook"
* for HTML mail there is simply oItem.HTMLBody to put in any HTML

** To attach a file
oitem.Attachments.Add("MyFullPath+MyFile+Ext")
** to attach one more file.. and you can repeat this.
* oitem.Attachments.Add("MyFullPath+MyFile+Ext")

** to send it
oitem.send()

** to clear up
oOutlook=.null.
 
Solution
Well, for outlook.application automation clearly not. For the alternative MAPI automation any MAPI compliant mail cient software. Which Thunderbird is.

You need all new code and MAPI is also not that simple to establish, especially with the dependencies you have about a mapi ocx, then, or DLLs establishing MAPI or at least simple MAPI, depending on what Windows version is used.

But why don't you try wOOdys advice, first? Is there no "Revert to Outlook Classic" (or similar) option? And can't you simply go for a classic Outlook desktop version? Didn't I point it out good enough that New Outlook is not the same product line and the latest major classic Outlook desktop versions still provides the Outlook.Application COM automation option...
"class outlook.application is not found " is stating outlook isn't installed. At least it's automation server is not registered. In a not very old thread we concluded this will be the final fate of such mail automation, as MS strips off this automation possibility in future Outlook versions.

So which Outlook version is used, here?
 
we d/l this one
 
Microsoft had a line of free Mail clients for home users which never was COM automatable. I think it started with "Microsoft Internet Mail and News", later became "Outlook Express", then "(Windows) Live Mail" "(Windows) Mail" and now "Outlook for Windows" aka "The New Oulook" or "Monarch" or "One Outlook" and "Modern Outlook". All products of this line are not automatable, not even by the MAPI standard.

Only the Outolok Yeranumber and Outlook of Office 365 desktop versions are automatable. Note, there are also streamed and web oriented versions still not COM automatable, the web versions only via a web API.

In short, you should have informed yourself which version of Outlook (and/or Office) you need to keep the COM automatable feature with the "Outlook.Application" COM automation server class. That's an external dependency you have, not a FoxPro class.

So get the major Outlook version or remove the mail automation feature from your software.
 
Last edited:
If you upgraded from "Outlook (classic)" to that damn "Outlook (New)", the menu will have an option like "Revert to Outlook Classic". Do that. If that option not available, uninstall and reinstall the regular "Outlook (classic)" in 32Bit variant.
Then set all this registry keys from the attached file. This will disable all nagging for that dumb new version on that PC.
 

Attachments

Is there another email client that I can use, such as Thunderbird or something?
 
Well, for outlook.application automation clearly not. For the alternative MAPI automation any MAPI compliant mail cient software. Which Thunderbird is.

You need all new code and MAPI is also not that simple to establish, especially with the dependencies you have about a mapi ocx, then, or DLLs establishing MAPI or at least simple MAPI, depending on what Windows version is used.

But why don't you try wOOdys advice, first? Is there no "Revert to Outlook Classic" (or similar) option? And can't you simply go for a classic Outlook desktop version? Didn't I point it out good enough that New Outlook is not the same product line and the latest major classic Outlook desktop versions still provides the Outlook.Application COM automation option but automation is simply not and never will be part of the Home user product line? New Outlook/Outlook for Windows is not the "professional" version is how to think about it.

No matter, if an easy way to go back to classic Office Outlook is missing and you need to install it from scratch instead, why don't you simply do so to keep your code working?
 
Last edited:
Solution
I will go dig up my older version of classic Outlook and it's product key :) Thanks everyone. Star to Chriss!
 
Did you get back to a working situation, already? If you fail to get back to your old version from CD again, I think this will interest you:

And this: https://support.microsoft.com/en-us...ndows-pc-5c94902b-31a5-4274-abb0-b07f4661edf5

So I see a quite convoluted situation regarding new devices coming with Outlook licenses and classic Outlook in the style of new Outlook confusing what you even actually have. The revert feature wOOdy mentioned might not be shown within New Outlook, but within classic Outlook just configured to show the new UI. And then there is a revert option within New Outlook, actually, too. I have neither New Outlook nor classic Outlook with new look and can't see how these options differ in their look&feel. A google image search shows several switches and different texts for the reverting, and I guess that's because these are qualitative different things done, just changing the skin or actually uninstalling New Outlook and reinstalling classic Outlook.

Outlook.Application not being registered points out you don't just have the New outlook styling within a classic Outlook, as I don't see why that would turn off the automation server and available information in the registry. So you should be fine after reinstalling from CD. Just note the description of a situation where someone had classic Outlook and tried New Outlook as a preview:

If you toggled into the new Outlook for Windows preview from classic Outlook for Windows, every time you try to launch classic Outlook for Windows you'll be redirected to the new Outlook for Windows preview. You can go back to classic Outlook for Windows by selecting the toggle in the new Outlook for Windows app.
So that tells one additional caveat launching classic Outlook being redirected to New Outlook. As if the "New" version was the version MS would prefer users to change to in any case. Though it lacks the automation feature, but its look&feel is more modern, perhaps? And based on UWP, perhaps?

We had a now middle aged thread about mail automation with CDO failing, which is a thing that's a MS specific, again, and also shoulders on MAPI. And some predicted MS would remove the CDO and OLE automation. I think now - in the light about this restart of the home product line - the classic Outlook including not only the OLE automation but also all the Office/Outlook object model that's also integral part of VBA within Office will not be discontinued. You just need to watch out you stay in the right lane of that classic Office product line.
 

Part and Inventory Search

Sponsor

Back
Top