Excel VBA email using Outlook Quick Steps

xxbc320xx

New Member
Joined
Mar 27, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have a macro for sending a sheet or multiple using a command button click. I have to put each email address I want into the code itself.

I have another project I am working on with a group of emails that tend to chance as people come and go from a couple organizations. Right now I use a "Quick Steps" on outlook for sending an email to this group. I would like to use that for the the TO field in my VBA code. I set up a test group and outlook didn't recognize the address as it was just the name of the "Quick Steps" group. When I use the "Quick Steps" in outlook, I see each email as an individual and not the "Quick Steps" name. Below is the relevant part of the code.

With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "Email Macro Test"
.CC = ""
.BCC = ""
.Subject = "Macro Email test"
.Body = ""
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.display 'or use .Display
End With
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I'm not finding that it is possible to access Quick Steps via VBA. However, I have a suggestion that might work. I created a new Contact group called TestGroup and added a couple of my email addresses for test. I then created a new Quick Steps action to send an email to the TestGroup by selecting the group as the only To destination. In Excel, I used .To = "TestGroup" and followed that with ".Recipients.ResolveAll" in addition to the rest of the mailItem parameters.

In this way, the Quick Steps in Outlook still works, and Excel can reference the Contact group. As users come and go, you'd have to change the Contact group rather than the Quick Steps actions.
 
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,106
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top