VBA Code to Email using the Free Version of the Outlook App. (2 Viewers)

JTBrown

New member
Local time
Today, 14:03
Joined
Nov 24, 2024
Messages
4
I have been using the objOutlook.CreateItem(olMailItem) and the DoCmd.sendObject AcSendQuery and the code I have has been working great on machines that have the Desktop version of Outlook installed.
I have 2 laptops with no need for MS365 as they are data entry terminals and send the data via email. They have the Free Outlook App downloaded from the Windows App Store.
However, when the code calls the Email Function it attempts to open the Classic Outlook version as part of MS365 and request a License Code, not the Free App.
This work is for a Non-profit and although I am sure they will approve the software cost, if anyone has a code solution idea, I would greatly appreciate the suggestions.
I have also used the following with success on a single email but have the same issue.
 
Neither the web version of Outlook nor the desktop New Outlook can be automated. Your choices are to use the classic desktop Outlook or bypass Outlook and use CDO from Access or possibly the badly named Graph API
 
What is the default mail app?
 
Darn it, Colin, you beat me to it by just a minute or so. "New" Outlook cannot be automated using VBA because New Outlook doesn't support the Component Object Model. Web Outlook won't do that either.

If all you are doing is sending, look up CDO (Collaboration Data Objects) which employs the SMTP method of sending mail directly from your computer through a mail gateway.
 
Like IslaDogs said, the free Outlook app cannot be automated. I recommend using CDO (Collaboration Data Objects) instead, which lets you send email directly from Access through SMTP without needing Outlook at all. There are tutorials online that show you how to set this up. If you search for "youtube access send email cdo" you should find a good step-by-step walkthrough.
 
Thanks to everyone for the replies. I will just ask the management to spend the money. Just in hopes to avoid that if I had misses something.
We can consider this closed.
 
Before you do that, suggest you at least try using CDO to send email. CDO is easy to setup and won't be affected when MS eventually discontinues Classic Outlook in a few years time
 
I tested with Colin's app. I cannot use CDO with Outlook any more. Been a while since I tried but as I recall this requires some kind of account I can't have as an individual.

However, I can get CDO to work with Gmail. I did have to set up a special Google account. Although, my phone email app is not seeing these.
 
@June7
Not sure what you are referring to: GMail and Outlook email accounts or the two applications?

The whole point of CDO is that there is no need to make use of external email applications. Having said that, I do have code to use CDO with Outlook for those who prefer to use it as an intermediary step.

For GMail accounts it is necessary to setup an app password. That works well.

I have also tried (unsuccessfully) to setup something similar for using two factor authentication with CDO via EntraID.
 
Thanks to everyone for the replies. I will just ask the management to spend the money. Just in hopes to avoid that if I had misses something.
We can consider this closed.
done.
 
Thanks to everyone for the replies. I will just ask the management to spend the money. Just in hopes to avoid that if I had misses something.
We can consider this closed.
Please mark it as Closed then. Top right of thread.
 

Users who are viewing this thread

Back
Top Bottom