Excel 2010 macros won't work with Outlook 2010

DougRobertson

Active Member
Joined
Sep 22, 2009
Messages
334
Office Version
  1. 365
Platform
  1. Windows
Hello,
Below is code that I use to have a macro create an email, with the 'To' box containing the Outlook Distribution List "FAMILY".
Normally, in 2007, the "FAMILY" code connects with the "FAMILY" Distribution List in Outlook Contacts, and away we go.
However, even though the word "FAMILY" is entered into the 'To' box, it won't connect it with the Distribution List, and thus it won't recognize any email addresses.
Any ideas?

=====

Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(otlMailItem)
With otlNewMail
.To = "FAMILY"
.Subject = "REPORT"
.Body = Chr(14) & "Hi!"
.Display
.Application.ActiveWindow.WindowState = 2
End With

=====

Thanks,
~ Doug
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hey Doug

Have you tried sending the Email anyway?

I've got a macro that creates an Email to a distribution list set up in Outlook but when the Email is created it doesn't bold/underline in the 'To' box as it does normally in Outlook, but, the Email still sends as expected to the correct people.

Beyond that I can't really help but thought it might be worth a mention :)
 
Upvote 0
I'm afraid that's how I found out it wasn't working. I got a couple of versions of Warning Messages, and it wouldn't / couldn't send! It's worked for years, and I can't figure out what has changed.

Thanks for your consideration though!

~ Doug
 
Upvote 0
Oh great! Now it decides to work.
In the last few minutes I tried the Add/Remove Program area, and used the Repair tool. That may have been the trick.
The error messages were something like "There is no address in the address box." which of course was not true. I have found the same problem when Exporting / Importing my Contacts folder information, and all Contact Group (Distribution List) folders are empty.
Thanks for answering the call Andrew! And I sincerely hope you have a very nice day.

~ Doug
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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